Octopress 3

| Tags: blogging

It’s now a bit more than two years since I started using Octopress to generate this website. Although Octopress was always reliable and a joy to use, one aspect bothered me from the beginning.

To use Octopress you had to clone its git repository and add your stuff into it. So there was no separation between the source of the website and the tool to generate it.

This changes with the new Octopress 3 which is now a set of Ruby Gems. Things which were earlier part of Octopress are now available as plugins and it’s quite easy to activate the usage of a plugin. Octopress 3 isn’t finished yet. For some of it’s parts release candidates are available while others are already marked “1.0” or higher. The biggest missing thing is probably an updated documentation and some kind of guide how to move from Octopress 2 to Octopress 3. octopress.org already gives an overview of what’s coming.

My website is a rather simple one. So I took the plunge and ported it to Octopress 3. I got Octopress to generate a new site with octopress new and found that it generated a directory structure that I was partly familiar with. That’s really no wonder as both are Jekyll sites and although Octopress 3 supports the current version of Jekyll where my Octopress 2 site still used a much older one, the main building blocks of a Jekyll site stay the same. There’s still a folder for posts and others for templates and includes. I replaced the generated stuff with the counterparts of my Octopress 2 site.

After temporarily deleting some parts that depended on plugins I hadn’t found Octopress 3 replacements for yet, I got a first raw site that looked OK.

Now I had to weed through _config.yml. Octopress 2 had generated a bunch of entries here I didn’t see in the generated output from Octopress 3. Some of them I could ignore, because I hadn’t filled them in for the old version. Those were settings for various social networks like Facebook, Twitter and so on. Others I had to search for on jekyllrb.com to verify that they are Jekyll settings and not some Octopress specialty that might not exist in Octopress 3.

One of those Octopress specific settings is date_format which allows to define a format for dates and then provides convenient functions to get dates in that format. This is one of the Octopress features which are now extracted into a separate plugin octopress-date-format.

Jekyll now handles SASS directly and with octopress-asset-pipeline the resulting CSS can be merged with other CSS files like normalize.css and minified.

I was lucky that one of the plugins my site depends on, jekyll-tagging, still works with the newest Jekyll and Octopress 3. So that was quite easy.

The next one was harder. Since the early days of the blog — when I used MovableType —, the site provides monthly archives and an overview of the times when I wrote something. When I moved to Octopress 2 I searched and finally found one Jekyll plugin that created the monthly archive pages. After playing around with it some time I succeeded to add the overview to it. Unfortunately that plugin didn’t work with Octopress 3 and the newest Jekyll. Luckily while browsing the list of Jekyll plugins I found one that did most of what I needed: jekyll-monthly-archive-plugin. After reactivating my dormant Ruby knowledge and trying around, I succeeded to make it do what I wanted. There surely is a more elegant way to do it, but here it is for anyone interested. You just need to put {{"{{ site | archive_block "}}}} somewhere you want that archive overview block to appear.

I’ve been using Octopress 3 for nearly 8 months now. Sometimes when I update the Octopress gems, something breaks, but the developers of it are usually fast at finding and fixing the problem. If it takes them longer I always can go back to the last collection of Ruby Gems that worked as I use git to keep the history of all changes I make to it.