Alex headshot

AlBlue’s Blog

Macs, Modularity and More

Migrated to Octopress

2012

As I mentioned in my prior post I have completed my transition off of the old Blogger infrastructure and onto a self-hosted Octopress solution.

Several people have asked about the specifics behind the move, including the why, how, and where. This post is an attempt at answering some of those questions.

One of the results of the transition is that the comments from the previous site are gone. I may enable comments via a third-party solution like Disqus in the near future, or I may follow Matt Gemmell’s lead and refrain from enabling them again. In the meantime, if you have comments, please feel free to send them to me on Twitter via @alblue or by e-mail, by replacing the first preiod with an at symbol in the domain name.

Why?

Well, as if the Google Reader Debacle and the in-your-face Google+ infection that is going viral on the Google sites, the policy overhaul really was the last straw.

I remember when Google was known for its excellent search. It had hits and misses with Google Mail, Google Maps as well as Google Wave and Google Buzz. But its fear of mamoths like Facebook and elephants like Twitter, it has come up with a dungbeetle of an infectious system which you can’t avoid even if you want to. As a result, it has become necessary to use proxies like DuckDuckGo – which has a user interface reminiscent of the age-old Google search – and get out of services like Reader and Maps. This transition off of Blogger is more a going from, rather going to, a particular solution. Mail is something yet to be transitioned.

How?

I planned to move off of Blogger and wanted an easy solution to migrate to. I could have gone with another service, like Wordpress, but recently there have been some concerning issues with the likes of SOPA which can take out a .com domain at will, and moving to a solution which is at risk of remote termination is something which I’d prefer not have to be reactionary to avoid. Whilst the domain name here still ends in .com, the plan is to move to a .uk based domain name with which I can alias these posts and this hosting service.

I have written about Gollum and Jekyll before, and the ability to store all my source posts in a Git repository met one of my goals – to have my blog backed up and available for remote recovery. (In fact, my recovery strategy is moving off of ZFS snapshots and moving towards remote Git repositories.) The fact that the posts can be written in the human readable Markdown format, instead of requiring only HTML, means that writing posts on the iPhone is now much more palletable than it was before. Many of the rich editors aren’t supported on the iPhone, and having to write out tags manually are next to impossible on a limited keyboard device.

So, the plan was to switch over to a Git-backed, Markdown authoring content solution. (Of course, it helps that Markdown is a superset of HTML, in that any HTML can be put into a Markdown document and be passed through.) This let me to Jekyll and Jeykll-derivatives for hosting the solution. Whilst it would have been possible to roll-my-own, bouncing off a jumpstart like Jeykll-bootstrap or Octopress made much more sense.

In the end, I went with Octopress for a few reasons, mostly relating to the plugins that are available and the customisation of the site. For example, I didn’t want to call my tags ‘categories’ and this was easy to change. Also, the generation of the category page by default links to the main site’s atom feed, whereas it’s actually pretty easy to link to a tag-specific feed. Therefore, people who only want to read about Eclipse can subscribe to the Eclipse feed and ignore all the other posts I may have here.

It also has great support for a Pygments-like solution for pretty-printing code. Although JavaScript solutions exist for code formatting and colouring, if the browser doesn’t hava JavaScript disabled then this won’t work. The Octopress solution uses an ahead-of-time translation into well formatted code, specific to each language. For example, if you want to convert a Blogger script to your own Jekyll instance, you can do:

```sh How to import from Blogger $ git clone https://gist.github.com/1807781 $ cd 1807781 $ ./bloggerImport.sh blogname # of blogname.blogspot.com form


That will check out your blog (first 500 posts only, and assuming you
have full posts enabled) and convert it into a Jeykll blog.

I had to make some changes to the standard Jekyll RSS importer, including:

* Use of `permalink:` in the YAML front matter to ensure consistency
* Use of `date:` instead of `time:`, which ironically parses the time properly
* Generation of `tags:` based on the Blogger tags

At some point I hope to contribute the above back to Jekyll, but they
are listed at the Gist above (including the diffs).

The posts themselves are really easy to author; this post starts:

```text Example post
---
layout: post
title: "Migrated to Octopress"
date: 2012-02-12 22:29
comments: true
tags:
 - "2012"
---

As I mentioned in my <a href="/2012/02/migrating-to-self-hosted-octopress.html">prior post</a>...

The other great thing is that these posts are easily processable into other formats at a later stage if desired. The YAML front matter allows you to add additional information which can be picked up and processed when the posts are generated. This was used to ensure that all prior Blogger-imported posts have the same date and url as before the transition.

This also permitted a tidy up of some past titles. Back in the day, before Blogger suppoted categories, I generate a per-tag feed using title filtration. This led to some blog titles being slightly ugly, which I couldn’t change without changing the URL. Now I’ve done the Octopress import, I can vary the title without changing the URL. Result!

Where?

Lastly, on why I chose a self-hosted solution instead of a third-party host like Wordpress. Well, I already had a website hosting solution (which I use for my mobile development company’s www.bandlem.com website, so adding another host to that was trivial. Having the flexibility of being in control of the source files was another important win; though it should be noted that GitHub have a pages which you can use to push to and achieve the same thing. (Moving to a GitHub hosted pages at a later stage is still an option, thanks to the Jekyll implementation behind Octopress.)

Would I recommend setting up your own hosting/website infrastructure for the purposes solely of providing a blog? Maybe not – but then again, if you have the infra in place to handle it, it can make sense. If you wanted to go down the Octopress/Jeykll route but didn’t want to go the full hosting solution, then I can highly recommend GitHub pages (which I use for github.bandlem.com as an Eclipse update site for things like my Full Screen Enabler for Eclipse on OSX).

Summary

Markdown really makes sense for wiki pages, because you can write up entries without having to concentrate on tags getting in your way. Even things like ‘ and “ get replaced with their &lsquo; and &rsquo; corresponding entities automatically – as well as double-dashes turning into an &ndash; entity.

For blogs with source code, Octopress provides the backtick support, so code blocks can be put in-place without having to leave the editor (or escaping things like < and > with their entities). It also does the colour-coding automatically.

Octopress adds other tags, such as the ability to (effectively) #import a file, so you don’t even need to pollute your markup/documentation with a source code file which you can cross reference. It also adds handy other features, such as the Gist tag, so that you can even see the Gist I referred to above with {% gist 1807781 %}:

Finally, I hope this now means I will pick up my blogging over and above the slow-down towards the end of last year and the start of this. The slow down was due to other features (which merits a separate blog post of its own) but clearly the migration has also taken some planning and execution to get right.

I hope you like the new look blog.