Alex headshot

AlBlue’s Blog

Macs, Modularity and More

Advantages of Octopress

Octopress is pretty good at a number of things, so I thought I’d take the time to enumerate a few of them in case you’re making up your mind as to whether it will suit you or not.

Jekyll based

Jeykll is GitHub’s site engine, which works on pages generated en masse written in Markdown and puts HTML in the way. Any time you’ve used GitHub’s pages, they’ve been using Jekyll to do the rendering (assuming you’re not just uploading HTML in batch).

This has the advantage of being a Git-backed system, and built in such a way that the site can be easily re-generated if the content changes. Furthermore, Jeykll supports a number of plugins which can be used to generate different kinds of content. Many of these plugins are exposed with a templating engine called Liquid which makes it easy to customise how individual pages look without having to go to the effort of having a server-side process generate them all the time.

Markdown content

Markdown is much, much easier than HTML to author in, or for that matter, any other XML based dialect like DocBook. I’ve been wanting to do something in DocBook for ages, but frankly, I’ve never really got around to doing anything. That’s not to say it’s not possible, but for the kind of short articles that blog posts end up being, Markdown just gets out of your way. It also doesn’t hurt that things like bulleted lists and emphasis tags are just a single character away, and that the text itself is readable as plain text as well as being renderable into valid HTML.

Markdown also has the advantage that HTML tags get passed straight through, so if you need to spend a little € or put <abbr> tags around abbreviations, you can do so in the source without affecting what it looks like at the other end.

About the only place that doesn’t use Markdown is Eclipse, who generally default to Mylyn’s WikiText. (though there’s a bug for that).

Stylish

As a developer, I am not a design expert. I certainly hadn’t heard of Solarized colours before. Instead, I have a blog which has been designed by someone else and made available as a default theme for Octopress. (It is possible to supply your own styles should you want to.)

The Markdown process also results in changing of double-dashes to &ndash; – so that I don’t have to put the entity in myself. It’s also got good support for “quoted words” as well as ‘apostrophes’ which I don’t have to remember. Although occasionally I used the &lsquo; and &rsquo; in my posts, I certainly didn’t replace every ’ in didn’t with the corresponding entity (or character value) – something which Markdown does automatically. In that regard, it’s like LaTeX but without all that \begin{document} stuff.

This also applies to things like code formatting, GitHub support and the like. Which leads me on to …

Plugins

Octopress has a number of plugins (driven by the Jekyll liquid templating system) which are installed as default. You don’t really need to use them, but it’s nice to be able to import a GitHub Gist with {% gist %}{% raw %} and just get on with it.

There are also some plugins – like Twitter integration – which make it easier to advertise your blog. (And yes, there’s Google+ if you’re a blogging Googler.) And these things can be made your own easily enough if you want to.

Summary

Octopress is a pretty good starting point for a Jekyll-based blog which has more style than you otherwise would invest in putting a blog together. If you don’t want to use Markdown, you can use vanilla HTML, but the Markdown features are a massive win.

If you don’t want to use GitHub/Jekyll to host your site then you can easily generate all the HTML files and then rsync to the host (like this blog does). Or you can store all the generated HTML in a Git repository and then just deploy that.

Octopress isn’t the only Jeykll game in town; there’s also Jekyll-bootstrap as well. Both do similar things; they use Jekyll for under-the-hood work, but supply it with a number of customised defaults to make you look good, even when your decapitated icon doesn’t.

Tomorrow, I’ll look at some of the issues I’ve found with Octopress so far.