James Endres Howell

Home | About | Archive | Tags | RSS
29 May 2021

Blogging with Emacs

Okay. I’ve tried it different ways before, but I’ve now settled on using org-static-blog to produce static pages to post a blog. It is the dead-simple workflow I have been looking for.

Now I only need something to write about.

Here’s how it’s configured in my init.el file:

(setq org-static-blog-publish-title        "The Education of James Endres Howell")
(setq org-static-blog-publish-url          "https://endres-howell.org/")
(setq org-static-blog-publish-directory    "~/org-files/blog/html")
(setq org-static-blog-posts-directory      "~/org-files/blog/posts/")
(setq org-static-blog-drafts-directory     "~/org-files/blog/drafts/")
(setq org-static-blog-enable-tags t)
(setq org-export-with-toc nil)
(setq org-export-with-section-numbers nil)

(setq org-static-blog-page-header
      "<meta name=\"author\" content=\"James Endres Howell\">
       <meta name=\"referrer\" content=\"no-referrer\">
       <link href= \"../static/style.css\" rel=\"stylesheet\" type=\"text/css\" />
       <link rel=\"icon\" href=\"../static/favicon.ico\">")

(setq org-static-blog-page-preamble
      "
       <div class=\"header\">
          <h1>The Education of James Endres Howell</h1>
|
          <a href=\"https://endres-howell.org\">Home</a>
|
          <a href=\"./about.html\">About</a>
|
          <a href=\"./archive.html\">Archive</a>
|
          <a href=\"./tags.html\">Tags</a>
|
          <a href=\"./rss.xml\">RSS</a>
|
       </div>")

;; This HTML code is inserted into the index page between the preamble and
;; the blog posts
(setq org-static-blog-index-front-matter "")

;; This postamble is inserted at the end of the <body> of every page:
;; This particular HTML creates a <div> with a link to the archive page
;; and a licensing stub.
(setq org-static-blog-page-postamble
       "<p xmlns:cc=\"https://creativecommons.org/ns#\">
          Distributed under the
          <a href=\"https://creativecommons.org/licenses/by-nc-sa/4.0/\"
             target=\"_blank\" rel=\"license noopener noreferrer\"
             style=\"display:inline-block;\">Attribution NonCommercial ShareAlike 4.0 International license. BY-NC-SA
             <img style=\"height:22px!important;margin-left:3px;vertical-align:text-bottom;\" src=\"https://mirrors.creativecommons.org/presskit/icons/cc.svg\"><img style=\"height:22px!important;margin-left:3px;vertical-align:text-bottom;\" src=\"https://mirrors.creativecommons.org/presskit/icons/by.svg\"><img style=\"height:22px!important;margin-left:3px;vertical-align:text-bottom;\" src=\"https://mirrors.creativecommons.org/presskit/icons/nc.svg\"><img style=\"height:22px!important;margin-left:3px;vertical-align:text-bottom;\" src=\"https://mirrors.creativecommons.org/presskit/icons/sa.svg\"></a>
         </p>
         <p>Created with
<a href=\"https://www.gnu.org/software/emacs/\">GNU Emacs</a>,
<a href=\"https://orgmode.org/\">Org mode</a>,
and
<a href=\"https://github.com/bastibe/org-static-blog\"><span style=\"font-family:monospace\">org-static-blog</span></a>.
")
Tags: blog

Distributed under the Attribution NonCommercial ShareAlike 4.0 International (BY-NC-SA) license.
These pages were created with GNU Emacs 26.3, Org mode 9.1.9, and org-static-blog. Theme modified from Matthew Bauer's CSS.