So long WordPress, G'day jekyll.


Finally, my blog moved from WordPress to jekyll, a popular static site generator. After getting bored by WordPress, getting sick of all the routine maintenance and growing security issues, it was time for a new player. A lot of people I’m following are praising jekyll (or octopress), so I had to give it a try. Currently I’m running several WordPress installations, for myself and customers. All these instances need a lot of attention. Every week I have to install updates, every week the same procedure for several sites, every week the risk of breaking something with an update. Granted, updating works like charm most of the time and problems occur rarely. Jekyll is simpler and able to solve most of these issues for me. Less updates and security problems, just good old static HTML files on my server. Furthermore markdown is my writing language of choice which already is at heart of jekyll by design. For sure, a site generator is not suitable for my customers, it’s a tech geek tool you have to invest more effort in, but it’s a tool that suits me well. Don’t get me wrong. WordPress is unbeaten in terms of convenience and amount of freely available extensions. It is a wonderful product! Bashing WordPress would never cross my mind - Nobody’s Perfect, so aren’t site generators!

Bring it on!

Migrating my posts to markdown files was easy with exitwp. This script translated all posts from an exported WordPress XML file with one line on the console. The HTML wire frame of my site got written quickly, it’s not so hard if you are familiar with template creation for WordPress or similar systems. For a quick start on how to create your first site consult jekyllbootstrap.com. Once ready for take off everything is still offline and needs to find it’s way to a web server. Page deployment comes in several flavors, mine is using the git post-receive hook feature of my git repository. Every time changes get pushed to my git server, a small script regenerates the site, done :-). This consolidated version control and distribution is very handy and solves everything perfectly for my taste.

post-receive script in my git repositories hooks folder

1
2
3
4
5
6
7
8
REPO=$HOME/repositories/mgratzer.com.git
CLONE=$HOME/tmp/mgratzer.com
WWW=/var/www/mgratzer.com
git clone $REPO $CLONE
cd $CLONE && jekyll --no-auto $CLONE $WWW
cd ~ && rm -rf $CLONE
chmod a+rwX -R $WWW
exit

My work flow changed. I’m generating the whole site locally, preview changes offline and finally push everything when ready for deployment. But this is also one of the mayor downsides, you need at least git access in order to change something (or a full jekyll stack if you choose a different deployment strategy). There is no web interface for quick changes, but that’s not important for me. With the constantly growing list of excellent markdown editors for my mobile platform of choice, I’m always capable to create content on the go.

One mayor issue was a replacement for the excellent NextGEN Gallery WordPress plug-in. I was able to append a bunch of pictures to my posts by uploading them to a folder and placing a line of markup. The rest, thumbnail generation and displaying the gallery, was done automatically without placing each picture manually in code. After searching for some nice JavaScript picture galleries I wrote my own simple tag plugin for jekyll. This plugin generates all JavaScript and markup for the GalleryView picture gallery based on a folder parameter.

By adding the following template code, the gallery shown at the bottom of this post is generated. All images placed in the folder praesbeton are nicely shown using the GalleryView script.

1
{% gallery_view praesbeton %}

If interested, look at this Git repository for a very first basic version of the plugin. I’ll try to improve it over time, for now this basic version has to do the job.

New friends

Jekyll is my new friend, I like it (him?) for being simple, flexible and scalable on every dimension. Let’s hope for a long friendship, because I’m already planning the migration of some other sites. If you want to migrate your own blog or learn how jekyll works in detail, have a look at this extensive tutorial by Vito Botta. If you have any questions on my migration process feel free to post a comments or contact me via twitter.