My blog posts written in the Org mode format. I export them using my ox-org-in-json exporter for Emacs and then consume them in JSON on my blog engine Elm frontend.
I use Org mode for all my writting, hence it only makes sense to use it for my blog as well.
Org mode already supports metadata, which allows for defining tags, draft status and the like.
Each blog post has its own directory YY-MM-DD-slug
. The main file will be simply named slug.org
, where slug
matches the slug used in the directory name. The .profile.zsh
file has mkpost
function to automate that, just call it with the slug and it will create the directory structure for you.
Any optional assets will be in the assets
subdirectory.
The output is a bunch of JSON files, which are easy for the frontend to consume. Wherever formatting is required, the Org mode format is used on the export side as well.
There is already ox-json
, but it exports a list of nodes. I want to export metadata and content, where the content is in the Org mode format.
org-js looks promising, I should be able to integrate it using custom elements on the Elm side. In the worst case I can write my own library using PEG.js. There is no PEG in the Elm landscape as far as I know, so that’d probably be the best option.