Switching to middleman

I've just switched my website over to Middleman.

Ikiwiki was okay for my blog, but I struggled with how to integrate it into the rest of the site, or how to even change the layout easily. (Maybe it's possible, but it didn't seem well documented when I last looked into it.)

I've used Ruby and Rails, and Middleman provides a familiar environment while being a static site generator (i.e. no runtime Ruby dependencies and no vulnerabilities to worry about). It allows me to wrap my site in a consistent layout, and use a variety of template languages (erb, haml, markdown, scss, and many more).

You can use metadata headers, or even external yaml files to control page content. I previously did this on another site to announce upcoming meetings. Using an external yaml file allowed me to have the date/time shown on multiple pages but only need to update in one place.

It's easy to store my site source in a dvcs and deploy the generated files. The blog extension is a little new, but works well enough for my simple needs. Over time, I'll probably make things looks a little nicer.

During the conversion I also adopted HTML5 Boilerplate. Middleman supports nested layouts, so I was able to use the boilerplate as an outer-most layout, then nest my sites headers/footers in another layout. For the blog part, I nested yet another layout (for adding a calendar and tag list in the future).

Middleman contains a development server, so you can run the web server and see changes to your files as you make them without having to re-generate over and over.

It's a pretty slick environment, but there are a few difficulties. It helps to be up to speed with Ruby and Rails development paradigms. It makes use of Bundler and gems, erb, haml, yaml, and stuff like that. The helper methods (for links, assets, etc) are derived from the Rails equivalents. The developers seem to mostly develop only on macs, so there are currently a few bugs I'm encountering on Debian that they don't see. Hopefully those will get ironed out though.

posted: Sep 19 2012
tags: