29 January 2012

I’ve been toying with the idea of moving away from Tumblr for a long time now, having had my own share of problems with Tumblr downtime.

I had made some steps into switching from Tumblr to Octopress, but the steps to deploy Octopress meant that I had to compile all of my pages each time I made a change, and then deploy them using rsync.

I’m now using Jekyll Bootstrap, hosted by GitHub. The steps to deploy are much easier, I just create a new markdown file for a post or page, write content using my text editor, and then deploy to GitHub using git.

Switching to Jekyll Bootstrap and maintaining all of my old Tumblr posts and urls has been a smooth process, I’ll detail this below:

After all of that, all that remains is adjust the permalink taxonomy, and creating a custom blog index (such as the one I’ve made) to display the latest posts.

So far I’m really happy with Jekyll, and for now I’m quite happy with using the Twitter Bootstrap style – in time I’m sure I’ll be tweaking and changing the style a bit to align it with my main website a bit better.

Update:

So a day or two after putting the new blog live, I realised that Google had indexed my old tumblr posts with the following permalink structure:

http://blog.omgmog.net/post/XXXXX/post-title-as-slug

but I’m using the shorter version, still valid from the old blog:

http://blog.omgmog.net/post/XXXXX

Which will actually be http://blog.omgmog.net/post/post-title-as-slug for new posts created with Jekyll.

A couple of my posts were high-traffic posts according to Google Analytics, so I had to sort out some sort of redirect for these posts so that the old indexed urls would still function, and visitors would find their way to the new posts. I found a Jekyll plugin called Jekyll Alias Generator which works by just adding a new alias: /path/for/alias to the YAML block on posts. The problem with this though is that GitHub hosted pages don’t allow you to use plugins with Jekyll, so I couldn’t cleanly deploy this by just adding alias to my YAML block and never thinking about it again.

The solution I found for this was to run the local Jekyll server with the rake preview command, so that it would generate the alias pages for each post and put them in the _site directory. I then copied the aliases for the posts I wanted to maintain to a new post folder in the root of my Jekyll repository (mirroring the post structure that I’m using), and then deployed these static HTML-based redirects to GitHub.

I’m not completely happy with this solution as it means I’ve now got a handful of static html files on GitHub that serve no purpose other than to redirect to new pages, but it works.

I’d like if GitHub would allow plugins in some form in the future, or give us some sort of solution for setting up pattern-based redirects, similar to how you would do with a .htaccess file on an Apache webserver.