;; This buffer is for notes you don't want to save, and for Lisp evaluation.
;; If you want to create a file, visit that file with C-x C-f,
;; then enter the text in that file's own buffer.

Static web site publishing from org-mode

Changes

  • Nov 06 2016: initial version

Motivation and Description

I generally prefer to work in GNU Emacs. When taking notes, planning, and authoring I use Org mode for Emacs. So it seems natural to author and publish articles for a web site like this directly from within Org mode. Of course, Org mode offers this functionality.

I also thought it would be a both nice and useful twist to have the web site styled as an Emacs frame, with a theme similar to the theme I use in Emacs (this web site features an navigation bar resembling Emacs menu-bar-mode - a mode I have disabled in Emacs, so it is not really similar). Nice, because minimalism can look good, and useful because a uniform look reduces the cognitive stress on my brain when I move my gaze from Emacs to the web browser.

I used Nicolas Petton's publisher as a start, and did some work to learn Emacs Lisp and to create the fancy Emacs look.

By calling

M-x org-publish

the Org mode's HTML exporter exports any modified article org-files and saves in the publishing directory.

As everything is implemented within Emacs, I can make use of other powerful Emacs packages for even more convenience. I have specified the publishing directory using Tramp syntax, pointing to my DMZ machine running an external web server:

:publishing-directory "/home-dmz:/var/www"

It is convenient to be able to both author and publish from within Emacs.

Screenshot

Here is a screenshot of Emacs with the source code for this article (not fully up to date though):

siteinfo.org.png

Todo

  • Emacs keystrokes - I might add one or two for fun.
  • RSS feed.
  • Tags - markup articles with topic tags and present in some sensible way.
  • Make the source code available.

;; Copyright (c) 2016, 2017
;; Per Weijnitz
;;
;; Verbatim copying and redistribution of this entire page are
;; permitted provided this notice is preserved.
;;
;; Check here for contact information.

-:-- Static web site publishing from org-mode (org-html-publish-to-html) 0.20      generator:Emacs 25.2.1 (Org mode 8.2.10)      generated:2017-05-05T07:57:28+02:00      ©2016 Per Weijnitz