jameswfrost.co.uk

home about archive

From WordPress to Jekyll

April 10 2009

Over the last week or so, I’ve migrated this blog from WordPress to Jekyll - a ‘blog-aware static site generator’, written in Ruby.

Jekyll takes a directory of posts and layouts, runs them through various converters, and produces a static website. Posts are stored in plain text files written in Markdown which makes it super easy to write HTML documents without the need to actually write HTML (and thus lose your flow). For example, making bold text is as simple as **this**. When Jekyll runs, it takes these posts, converts them into HTML, inserts them into an HTML layout, and produces a static HTML file. It’s really rather neat. If you want to see an example of how the back-end’s organized, check out this example of a Jekyll website on GitHub.

The main advantages, for me, are:

One downside of static files is that this means that the site can’t run its own commenting system. However, I’m using Disqus (a javascript solution) which seems ok. It’s a little more intrusive than I’d like, but I can live with it.

Using Git allows me to automate the regeneration of my site when I write a new entry. I write the post in a local clone of the site’s Git repo (or, on my server if necessary), commit my changes, and push them to the master repository on the server. When the server receives the changes, a handy little Git post-update hook that I wrote pulls the changes into the ‘live’ repository, and runs Jekyll to regenerate the site. It’s rather cool.

Now to work on:

A. Writing more.
B. Writing better.

blog comments powered by Disqus