WordPress to Jekyll
Why the move?
Here are a few reasons why I decided to make the move:
- minimalism - I try to keep things simple. Publishing via my favorite text editor and a simple command line publishing interface is a nice change from the bloated and dumbed-down WordPress editor. This allows me to be more focused on what I'm writing.
- speed - although you can cache content in WordPress via plug-ins, the speed of static content still cannot be matched.
- elimination of risk - although WordPress is still regarded as the best and most widely-used blogging software out there, it's still plagued with the occasional security hole. These are generally rectified fairly fast through point releases but still requires the site owner to keep the site running with the latest and greatest version. There is virtually no risk with a static site.
Overview of the transition
The transition was relatively easy with just a couple of hiccups.
The first hiccup was getting the MySQL gem installed on my OS X workstation. Once the mysql and sequel gems were installed it was a matter of configuring a Ruby script to connect to my existing WordPress database. Once this was done, it took literally a couple of seconds for the script to read all my existing WordPress posts from the database and create Markdown files.
The second hiccup wasn't really an issue but a bit of housekeeping which was tedious but necessary. Jekyll will spit out messages regarding badly formed markup as it takes the content you write and generates HTML. This is a great way to be sure your markup is up to par but was time-consuming to go through each of my posts and clean them up. I converted some of the heavy HTML created by WordPress's GUI editor to the lighter Markdown syntax.
The Jekyll publishing process
You have a couple of options in terms of the markup you can use for your content in Jekyll. I decided to go with Markdown. It's interchangeable with normal HTML and has some nice shortcuts for generating tags, etc.
The process for publishing a new post goes something like this:
- start Jekyll at the command line:
jekyll --server --auto --permalink prettyThis will start a local web server and allow you to see your changes by simply refreshing your browser.
- create a new file with some meta information at the top such as the title and the layout you would like to use.
- write your post's content using your favorite text editor. At the moment I'm using TextMate which I'm pretty happy with since it has Markdown highlighting, etc. Along with Markdown, Jekyll provides a variety of data available to your pages via the Liquid markup.
- save, and wait for the HTML to be generated.
- upload the generated changes to any web server that is capable of serving static HTML.
Although I'm just getting started with using Jekyll, the beauty is that you can make the process of writing as simple or as complicated as you want it to be. A couple of items I'm going to incorporate is adding Google custom search and possibly DISQUS to add commenting capability back.