On Static Site Generators

Static site generators seem to be the current in-vogue project an individual can craft in their spare time. All the tools you need to plop one together are there, in numerous languages: a markup->html compiler, a syntax highlighter, a simple web server, a file watcher, and of course myriad css and js frameworks, transpilers and minifiers.

In turn we have a myriad of static site generators. No one thinks the set of constraints and flexibilities that anyone else's implements is quite right for their situation, and I think this is a good thing. The more I get to experiment with, or cynically judge unworthy!

This is my first post using one now. I have used Octopress before, but the theming and post creation process was too involved. That may seem incredulous to anyone that has used it, and indeed I still think it's a great project, but the barrier-to-entry of creating a post needs to be practically zero. If you wish to change your post's title, there's a little messing around involved, not good enough! Creating a new theme for it is also a little daunting. Not anything impossible, simply more nit-picky than I'd like.

However, Octopress is based on the awesome Jekyll, which I have used to help create some great tutorials, so it's not all bad. Really, it's hard not to be awesome when Github will compile and host Jekyll for you!

Recently I've been wanting to check out some of the tools surrounding NodeJS so I decided to create this blog using one of its packages. My main constraint in choosing from the gaggle (or hundreds, between everything available from Node, Ruby, Python and Go) was something with extracted themes.

What's so hard about separating content (...the blog/site) from presentation (how it looks)? I thought people had learnt this lesson way back in the early 2000s when they decided <center> really wasn't the way to go. What's my idea here? Well, simple - include a theme as a git submodule. If I want to change look, there's no more messing around with three or four different folders, trying to figure out what is central to a basic look and what gives things pizzazz - just clone a different theme's repository.

I had looked at Wintersmith recently, just to start getting my feet wet with npm and node, but it didn't have this idea baked in. I've since come across Cabin, which comes very close. You can at least choose any theme you'd like, by passing it a Github project path, e.g. CabinJS/Blok (there's an option to test with local ones as well), and customise thereafter. Cabin is what has generated this page so far. It's still not quite there with truly plug-and-play theme-ability, but it'll do until I decide to add my own contribution to the list of these types of projects, or someone steals (...implements) the idea completely first.

In fact the Node Package Manager has become so littered with composable tools that Cabin is little more than a Gruntfile generator (ok, a bit more than that). This speaks a little to the advantages of following "The Unix Way" (although I don't believe it's always necessarily best to follow that dogmatically), and what enables. I just wish npm would grab packages a little faster for an Australian connection.

Cabin is composed of its own page generator (making use of jade templates), compass for some basic styling, pygments for syntax highlighting, and various grunt plugins for moving files around and serving them to your browser. Seriously, you need three different scripting languages installed to get full use out of this thing! Overhead, shmoverhead, we've got laziness to enable.

You'll probably love static site generators best if you like editing a pure-text format like markdown, but their other major feature is that there are plenty of options to host them for free these days, and they're pretty much non-hackable. As far as I know.

Is there some ridiculously easy to use static site generator that you know of? Or is it way too powerful for its own good? How many options does it have? Let me know.

- Matt.

CabinJS