February 17th 2010 Dr. Jekyll and Monkey Robot

Over the past couple of years, I’ve tried to get away from writing “meta posts”, that is, posts about my blog. Although I was once interested in writing software just for the sake of writing software, I’ve switched my stance: software is about a goal. In the case of Monkey Robot, the software that powers the site isn’t interesting in and of itself; what is interesting is how I use it to publish my thoughts. Or in other words, most people don’t care what blogging engine I use, so long as they have something fun to read.

But I’ve recently switched my blogging “engine”, and that's resulted in some changes to the site that I thought I should mention.

To cut to the chase, I now use Jekyll to generate the site, which is quite a change because the site is no longer really dynamic—that is, what you see are static HTML files, not “files” pulled from a database and constructed for you on a per-request basis. (I hope this doesn’t make you feel less special.) This is a departure from the traditional architecture of my blog, which was originally written in VBScript back in September 2004, and then re-written in Python, using the Django web framework, in December 2008.

The why behind the change comes down to two key reasons:

  1. Like any good programmer, I use version control to maintain my website, but the actual blog articles were simply dumped into a database. It occurred to me that I had this procedure backwards: the code that powers the site could easily be rewritten in a matter of a couple weeks if I somehow lost it, but if I lost my blog posts…well, I couldn’t ever recreate all of those. Sure, I had database backups, but I didn’t have a complete history of all changes to the content.
  2. When I disabled comments back in May, the site’s content essentially became static, so why hit a database every time I need to retrieve a page? Or worse, why fire up a Python process just to handle what is essentially static content? (For the more technically inclined: Yes, I was using FastCGI in combination with Apache to serve the site, which theoretically meant I didn’t have to fire up a Python process every time a request came in—but because I was on a shared host, my Python processes were killed off fairly quickly.) Since everything is just an HTML file now, page loads should be a lot zippier.

I’m very happy with the change. Not much has changed; the URLs have stayed the same, but unfortunately there are a few minor changes, as well as some features from the old site that I haven’t managed to port over:

  1. The Archives page isn’t broken into individual months anymore. I’m still trying to figure out how to do that with Jekyll.
  2. I removed pagination for the blog, so you can’t browse by page for the time being. (I don’t think many people did that anyway.)
  3. I switched to using an Atom feed for syndication (I was using RSS 2.0 before). The URL is still the same, but if you follow my feed in a feed reader, you may see duplicate entries (sorry about that).
  4. Oh, and the random article link is gone—not possible to do on a static site.

Despite the annoyances, I am enjoying Jekyll, and I highly recommend it. Here’s to the new Monkey Robot: just like the old Monkey Robot, but better!