Using ox-hugo To Build Websites with Emacs
April 19 2018 18:06 -0700
This article explains in detail the process of setting up a bare-bones website using Hugo and Org mode. My goal in writing this is to provide readers with a superior understanding of the fundamentals of this workflow. It is by no means an exhaustive explanation of Org mode or Emacs, but should give readers of any skill level a strong foundation to apply their own knowledge and techniques to the Emacs-Hugo toolchain.
I assume only beginner-level knowledge of Emacs.
Intro & Setup
Kaushal Modi created ox-hugo on top of his ox-blackfriday package, providing an impressive amount of features for organizing blog text and linked data with Hugo. He maintains great documentation and ample examples for using the package. I will explain my own workflow here, but for an exhaustive (though terse) reference, I highly recommend Modi’s test site and post source Org file, which contain demonstrations and tests for all of ox-hugo’s features.
After issuing the Emacs command
M-x package-install RET ox-hugo …
I did a blog
April 6 2018 18:29 -0700
ox-hugo is an Emacs package for Org mode that produces input for the static content generator Hugo, which I use for this website. Today I integrated its expectations about file structure into the Speedy theme for this blog, allowing me to keep all blog contents in a single Org mode file and export markdown content for Hugo’s excellent blackfriday markdown parser (a markdown format with many added features). Hugo does support limited parsing of org files internally, but Org mode features like inline spreadsheets and system communication are beyond the scope of most external tools, so Org mode is best used as an exporter. As an Emacs user, this allows me to instantly capture interesting information I come across and publish it within seconds. Now I have no excuses!