home | library | resume

Personal Pages, Powered by Pandoc

2023 Dec 09


I just finished reimplementing this website using pandoc, and am feeling reasonably good about the longevity of this implementation. Here's roughly how it works:

This feels an order of magnitude better than all the Jekyll shenanigans I was wrangling in the previous setup.

Requirements

Here's what I identified as requirements when re-implementing all this:

I realized some time ago that GitHub had, at some point, launched support for building GitHub Pages using a custom GitHub workflow. This meant that I was no longer tied to using Jekyll for my personal website, and I could abandon all the Gemfile and bundler stuff.

Every single time I've tried to run my website locally since college - when I first fleshed out the Jekyll implementation - I got stuck re-learning how to set up all the Ruby dependencies and just gave up.

Options

Static site generation tools were really the only things I considered:

If I hadn't gone with pandoc, it probably would've been Hugo:

But ultimately, thinking back to all the times I tried to re-learn how Jekyll worked and how much time I had to spend browsing Jekyll documentation... I decided that Hugo most likely has too many features for me to need.

Retrospective

I didn't do the best job of identifying all the requirements up front - I didn't quite appreciate how much templating functionality I was going to need for what I wanted to do. Fortunately pandoc's template system is sufficiently powerful for me (and it wouldn't have been too terrible hand-rolling it, I think).

I don't love that I had to use Pandoc Lua filters for some of the business logic, in addition to build.sh, but it's a more low-dependency setup than any of the alternatives. If I hadn't been able to do that, I would've written something in either Python or JS to manage it, since those filters - one for generating the list of blog posts, and another for attaching the date to each blog post - need to do YAML front matter parsing.

I guess that's another thing I didn't realize upfront - that every page needs some kind of metadata annotation, for things like titles and whatnot, which you can't embed in the filename - at least, not if you want the filenames to be easy to work with. (For the dates on blog posts, I've embedded those into the filenames.)

There's definitely a bunch of good though:

Overall, I think, a success!