Blogging Like a Hacker: Part One

25 Feb 2010

For years I’ve been using Mephisto to manage my blog, and updating the rest of my site by hand. I’ve never been what you would call really happy with this arrangement, but it does get the job done. Then at some point my Mephisto install broke. The blog was still readable because everything was cached, but I couldn’t get into the admin interface and leaving comments would throw 500s. I tried to fix it a few times but with limited success. Eventually I just gave up.

I briefly considered WordPress, but their hosted offering doesn’t support custom themes or plugins, and I wasn’t going to install MySQL on my server just for blog software. For a couple of years, the new hotness has been static page generators, so I went down the path of evaluating Webby and Jekyll to see which was more suited to my purposes.

I decided my first task should be writing a tool to export my posts from Mephisto so I could have some content to play around with while I was making the rest of the site work. Immediately I ran into the first source of annoyance: how source files are laid out.

Webby effectively copies your entire source directory to the target, and then iterates over the files and processes anything it needs to. The problem with this is that you have to mirror the site structure you want in your source directory. So, in order to use the common /YYYY/MM/DD/slug.html permalink form, you’d need a tree that looks like this:

|-- 2010
|   |-- 01
|   |   `-- 15
|   |       `-- slug.txt
|   `-- 02
|       `-- 24
|           `-- slug.txt
`-- index.txt

By contrast, Jekyll has a _posts directory that you put your ‘dynamic’ content files in. You give them magical names like 2010-02-24-slug.markdown and it knows where to put the file, based on your site configuration. To replicate this layout in Jekyll:

|-- _posts
|   |-- 2010-01-15-slug.markdown
|   `-- 2010-02-24-slug.markdown
`-- index.html

For my tastes, the Jekyll scheme is preferable. I don’t want to have to maintain a deep folder hierachy, even if the tool provides handy Rake tasks for managing posts (as Webby does).

While we’re talking about files, it’s worth noting that Jekyll attempts to discern what filters it should used based on the filename. In Webby, you have to have the filter chain in each file’s header block. Lots and lots of repeating oneself.

Jekyll’s file organization isn’t all sunshines and lollipops, though. As we’ll see in a later post, once upon a time there was a “topics” feature in Jekyll that has since been removed. It would have made my life a lot easier, but instead it fuels another post.

tl;dr: summary

I settled on Jekyll. I’ll talk more about specific features and reasons in future posts, but based on the features available and the amount of work I would have to do to get off the ground, Jekyll was the right choice.

« go back