generating page contents from org-mode files

Posted on November 19, 2014

The markdown format is nice, but considering that I extensively use OrgMode, I investigated a bit to use org-mode files for generating the contents of this website. Indeed, org-mode files are supported by pandoc since version 1.12, which has been integrated in hakyll 4.5.2.

Generation of pages from org-mode files

This is straightforward. Here is an example of a simple build rule for Hakyll:

Metadata

Metadata are defined in an org-mode file with a dedicated format :

#FILE: mypage.org
#+TITLE: A page title

However, org-mode metadata are not recognised by Hakyll, especially if you want to exploit metadata in your build system. To do so, you need to create a metadata file that will describe your metadata with the syntax used by Hakyll, or to add a metadata header in the org-mode file:

#FILE: mypage.org.metadata
---
title: A page title
---

When such a metadata header is used, its contents override the org-mode metadata values.