Jekyll Migration and GitHub Hosting

· Read in about 2 min · (404 Words)
blog site github hosting

Recently, I’ve been working on moving my blog to GitHub, and I’ve ported it to Jekyll. This means it should be faster and more secure than Mephisto, which was always stuck several versions behind the current release, due to countless problems uploading and keeping the features I wanted. Thankfully, I’ve found ways of keeping those features with Jekyll.

It might be obvious to any past visitors that I’ve had a go at redesigning the site. The new design is based on mojombo’s and as so as with his repository everything but the _posts directory is MIT licensed.

Whilst getting everything set up I had to make some changes and tweaks to some scripts and settings to get the behaviour I wanted. I’ll list these below in the hope that they’ll be useful to future migrators.

First off is my Rakefile. This is used to build tags.html, since as far as I can see, there’s no easy way to enumerate tags in Jekyll 0.5.7 (and I can’t use a custom for for GitHub hosting). My Rakefile is based on one I found at http://gist.github.com/143571, and uses Jekyll to loop through the blog’s tags and generate lists. I’ve opted to sort the list by the number of posts in each tag, and added some JavaScript to collapse the lists. Anchors take the place of individual tag pages in Mephisto and other engines.

Next, Jekyll ships with converters for importing posts from various blogging engines. The Mephisto script didn’t support tagging, so I hacked the SQL to pull out the tags too, and insert them into the YAML frontmatter block. Here’s a gist of my modified code:

I’m certain that the SQL could be simplified fairly easily by someone who isn’t so much of an MySQL newbie.

I googled for information on Jekyll sitemaps, and found a useful post on squarepush containing just what I needed. I ended up with the following:

This does exactly what you’d expect.

Finally, a minor change which I hope will not cause too many problems is the Jekyll permalink setting. I’ve added:

permalink: /:year/:month/:day/:title

To my _config.yml. In order to paths as close as possible to my URL scheme on Mephisto. This might cause a few problems in cases where the year or month names are only one digit long; Jekyll pads them with a leading zero, whereas Mephisto didn’t. Hopefully this won’t manifest as anything more serious then broken links.

Comments