## A static blog compiler in emacs June 29, 2012 [emacs, jekyll, griffin, releases]

Back in the mid-to-late '90s, I had a hideous homepage on geocities or something similar; in dark blue text on a black background, serving no purpose, as was the style of the time (but at least it was Lynx friendly!). Anyway, at the time, it seemed logical to me that one should statically compile such sites, using templates to insert uniform headers and footers. So, I implemented my own with m4 and make; it might have even had a link-checking pass, I can't recall. I wrote way too much m4 in those days.

Anyway, time passed, things on the web came and went. The era of "blogs" and "CMSes" came, and with it came crippled browser-based administration of said sites. I wanted no part, and continued to lead the life of the hermit.

Around the same time that I decided to become less private in my life, a static blog generator called jekyll came into vogue. It seemed to me that things were coming back in the right direction, and I gave it a shot. It worked okay for trivial things, so I used it for a few different sites. I won't get into my misgivings about Ruby; that's material for a later post on language hipsterism.

So I used jekyll for a while without too many hassles, until I started a post (forthcoming) on suffix arrays. I needed to embed some math, so I tried to use mathjax. Well, getting markdown to play well with mathjax wasn't working, so I converted the post to textile. RedCloth barfs on the first non-ASCII character in the post, so I took a look at the source and thought long and hard about whether I was going to fix this serious bug all so I could shoehorn my usecase into some rinkydink markup language.

I wanted to write my posts with org-mode, which has sensible LaTeX-style math input, tables, and syntax highlighting that plays well with emacs. Org has its own publishing features, but I wasn't going to let that stop me from reinventing the wheel for the n­th time, alas. So I wrote a quick Jekyll-replacement that runs inside emacs and uses org-mode as the post format.

I replaced the liquid templating with a simple approach of reading and evaluating the contents of the tag as a Lisp expression. So, there's no interleaving of template tags and content, which hasn't been a problem for me yet.

Though it's a quick hack, I'm happy with it – it scratches my itch, and I'm sure to improve it as time goes on. Maybe it can turn into something useful for other people eventually, too.