Nanoc and this site.


So, I’m cur­rently work­ing on get­ting my house in order. By ‘my house’ I mean this web­site. I’ve been look­ing for a way to get a nice com­bi­na­tion blog, project port­fo­lio that a lot of soft­ware devel­op­ers seem to have. I decided early on that I wanted a sta­t­i­cally gen­er­ated site as that would sim­plify a lot of things from server secu­ri­ty, to main­te­nance. It’d be eas­ier to migrate. Also, and this is impor­tant, it would be a lot sim­pler to use Emacs as my pri­mary edi­tor if I use a sta­tic gen­er­a­tor rather than a solu­tion like Word­press or Blog­ger which gen­er­ally require edit­ing lit­tle boxes on a web­site which I hate. (I sus­pect this can be worked around with WP, but I’d rather not try.)

In look­ing for a sta­tic site gen­er­a­tor, I’d heard o Jekyll before, and decided to give it a shot. My plan was to use it in com­bi­na­tion with some­thing like Org-Jekyll to make draft­ing and pub­lish­ing posts sim­ple. I down­loaded it, started work­ing through the docs and attempt­ing to get a nice site togeth­er, and dis­cov­ered two things. The first is that Jekyll is very sim­plis­tic by design. It is exten­si­ble, but it was meant to work in a very par­tic­u­lar way that did­n’t quite mesh with my ambi­tions for this site. The other thing I learned was that there are actu­ally quite a lot of sta­tic site gen­er­a­tors to choose from.

Any­way, after some look­ing, I decided that nanoc was the clos­est to my ideal tool I was going to find with­out try­ing each and every sin­gle one. The pri­mary fea­ture that lead me to choose nanoc over Jekyll was that I can use ERB rather than the Liq­uid tem­plat­ing sys­tem. ERB is much more flex­i­ble than Liq­uid (this is by design as Liq­uid is meant to be safe; it does­n’t exe­cute any raw code so untrusted users can author it,) and I know Rails some­what so ERB is already in my skill set.

Nanoc exposes it’s inter­nals more than Jekyll but I feel it’s more flex­i­ble and relies less on con­ven­tion. I should be able to orga­nize the site to my lik­ing more eas­i­ly. The Rules file lets me not only spec­ify dif­fer­ent and mul­ti­ple fil­ters per page (as well as mul­ti­ple lay­outs) but also design my direc­tory struc­ture arbi­trar­i­ly. Jekyll is rel­a­tively inflex­i­ble in both cases; it requires a lit­tle hack­ing to devi­ate sig­nif­i­cantly from the defaults. This, arbi­trary meta­data, ‘items’ rather than pages as the pri­mary con­tent metaphor, and of course mul­ti­ple fil­ters, alto­gether are the fea­tures on which that I set­tled.

So, this site is clearly a work in pro­gress, but it’s get­ting closer to being done and I have I’m fairly cer­tain I can make it work the way I want. So here’s to look­ing for­ward.

    Last update: 21/8/2011

    blog comments powered by Disqus