Here We Go Again: Switching the SSG to Nanoc
I just recently switched to jekyll for this website and was very happy at first:
- it was indeed very simple to get something running quickly and with little effort
- a lot of functionality is builtin or very easy to realize
- it seems relatively widespread so there is a lot (relative) information to find on the internet about how to achieve some things
There is one point, however, where things started to get hairy for me: the templating language Liquid. It seems so very limited! And that’s probably not just a feeling or my opinion but a fact. I have found other to report the same and taking a look at the docs, there is not much there. It is probably enough for most use cases but even while just trying to get what I consider “the basics” up and running, I found things that I was unable to realize with it. Compared to e.g. Embedded Ruby where you have the full power of Ruby available to work with, it almost seems like a joke.
Again: This is probably fine for the average person just trying to publish some posts. But I like powerful tools that provide more or less limitless possibilities to shoot myself in the foot, just in case that I want to. In a similar vein I was/am a big fan of FVWM and Exim which are both excellent examples of tools that give you opportunity to change a lot more aspects of their behaviour when compared with other tools in their domain. And since I am a very technically inclined person and don’t shy away from the complexity of these tools because I have the technical knowledge and mental capacity to deal with the complexity, they work very well for me.
So, after looking into the available SSG options again, filtering out the implementation languages I want to avoid (Shell, Javascript, Java, ASP, etc.) there were not many options left and I ultimately went back to an option I had tried before, albeit not very seriously: Nanoc for various reasons:
- it is also written in ruby, so I should be able to deal with the code in case I encounter limitations I don’t want to accept
- it provides the very powerful templating engine ERB (Embedded Ruby)
- it has nice documentation
After working with it for a few days, I encountered some minor issues, made Pull Requests for them and the author reacted quite quickly, which is a big point in its favor as well.
There is only one thing I’m quite unhappy about: there does not seem to be an active community around it. There is no IRC channel, not even an unofficial one, with people in it. There is a gitter chatroom but it seems very much inactive. So the only way to get support for it seems to be generic forums like some stackexchange site, or just contacting the author via GitHub issues, though that’s kind of abusive of the intention of the “issues” feature.
I hope this will be the last post reporting about me switching SSG for a while and it currently seems that there is a good chance for that: I was able to implement all the functionality I need or want in just a few days of work and almost everything seems quite elegantly solved for now:
- restricting tags to a list of allowed tags, to prevent me from going wild and creating hundreds of tags
- dynamically generated tag overview page
- dynamically displaying tags on articles, linking to the corresponding tag overview
- dynamically creating a list of posts, both for all posts and for specific tags
- dynamically generating atom feeds, both for the whole site and for specific tags
- including the location of the RSS feed in the
<head>
attribute of a site - minimizing CSS
- dynamically generating the navigation menu to display which page is currently shown
- highlighting code snippets according to language
- telling in a post’s metadata which layout it’s supposed to use
- implementing alternative stylesheets, currently used for the code highlighting to choose a different theme (which actually and sadly seems to be a fringe feature of firefox)
There are only a few things I have not yet managed to achieve:
- either minimizing pretty-printing the HTML after generating it, as there seems to be no Ruby module for doing this
- using SASS or SCSS to generate the CSS, for similar reasons, but this seems to be something the Nanoc author is working on but is not yet available for me with the debian package of Nanoc
Please let me know what you think of the website (content, design, structure, everything) and the features I mentioned above or if you have any advice regarding my issue with minimizing/pretty-printing the HTML.