Tag: nanoc

Smartening up haml in nanoc

I’ve been tidying up around the place. Do you like it? It feels a lot cleaner to me.

(RSS subscribers are encouraged at this point to follow the link and read the article on the website proper.)

Custom markup in nanoc

If you’re maintaining a blog, you will probably want to put images in your posts at some point. If you have some fancy server-side blogging software to do this for you, you’re set. If, however, you’re using a set of files on your local drive, which somehow get turned into a website, you have to maintain your post images yourself.

This is the current setup, assuming I wrote a blog post in May 2014 which contained two images, “image.jpg” and “image2.jpg”:

Streamlining rules in nanoc

Nanoc is an excellent static site generator. Probably my favourite feature is the rule-based document generation system. This system makes it incredibly easy to “pipe” documents from a given folder or point in your file hierarchy to a specific url on your site, with support for as many filters as you want between the document and the unfinished product.

Rules come in three flavours, but we’re interested in two for this article: compile rules and routing rules. Compile rules tell a file what it should look like when it appears on the internet, while routing rules tell a file where it should end up relative to your site’s root: