A little bit of history

A few months ago I pulled the pin on my old Wordpress blog. My resaons for ditching Wordpress were:

  • I was not blogging regularly enough
  • While I was keeping relatively up with the release cycle of wordpress the attendant weight of the VPS i was running was starting to add up
  • I had realised the entire setup was costing me >$50USD per month.

So I chopped the site. Then I found myself with no method of writing other twitter. So then I immediately starting grubbing around for somethig else. Lo and behold Github Pages appeared and I thought yes, that's the ticket πŸ˜ƒ.

Now I couldn't possibly make it easy for myself

Once I made that decision my next thought was making the jump to actually writing something. Well that turned out to be more of an adventure. Like all contrary geeks I feel the need to be in my text editor a lot. My particular choice is emacs. Emacs is a fabulous (operating) system and one of it's major attractions is org mode. Org mode is one of those things that has numerous posts on the planet emacsen extolling it's virtues on a regular basis. Up to now I have never needed org mode. It's TODO functionality is neat but almost always needs some help and I rarely need to enter notes into computers (my colleagues may disagree with that…). So this seemed like a perfect opportunity for an epic yak shave πŸ˜‰. Basically I wanted to blog on Github Pages using emacs org mode.

So to business

You can't have a gihub pages blog without jekyll so after installing jekyll I then set about trying to get org mode to play nice with jekyll. As it turns out this blog post set me on the trail. Now the big difference here is that the auther is trying to set up a static site using org mode I want a blog. So once I had my org mode directory insode my jekyll site I tried to export and realised that the instructions were for a different version of org mode. So I needed to make my first set of mods. These were:

  • instead of using org-publish-org-to-html I needed to use org-html-publish-to-html as my publishing-function for the posts
  • The key combo of C-c C-e X doesn't work for me I needed to do C-c C-e P x. It's likely that I'll bind that to something else soon as that's quite a bit of typing.
  • I changed my publishing-directory to include _posts. So for me that's "~/software/robertpostill.github.io/_posts"

That took me to output that worked. However, the outcome was pretty rudimentary. So I knew I need something else. Now in jekyll world you use a concept called front matter. This is the metadata used to help jekyll fill in everything around your file, which is really just the html body section. I needed a way to get the front matter in without org mode choking on it. At which point this org mode documentation stepped in. Essentially I needed org mode to put in the fron matter without pre-processing it. Which leads to using the #+BEGIN and #+END HTML tags as per the example below.

Inserting code snippets requires a similar dance:

So right now I'm using gists to deal with code snippets or tricky markup like this:

More to do

From here I can blog at least a little. Now my tasks are:

  • Investigate org2jekyll
  • See if I can't find a sensible key binding for publishing
  • Make the jekyll build element seamless on my local dev box
  • Make the git piece seamless.

All in all that was quite enjoyable πŸ˜ƒ