Migration to nanoc

This week-end I finally took some time to migrate this blog to nanoc, a Ruby web publishing system that generates semi-static websites. I already covered it a bit nearly 2 years ago (see this article in french).

In the past I used to blog with Dotclear, then Mephisto, and finally Simplelog. Simplelog was an abandonned projects at the time, locked with a very old rails version (1.2.x), and I started to port it under sqlite3 and rails 2.1.2. Though I really enjoyed Simplelog simple and clean admin panel, I never had enough time to maintain it and it rapidly became part of the problem rather than part of the solution.

So what's great now with nanoc ?

1/ it's simple : I only need my favorite text editor and git versionning to edit articles. A ruby runtime is needed whenever I want to publish my work (e.g. generate the static html pages from the sources, erb+markdown in my case)

2/ it's secure : it generates static websites, so I don't have to bother if someone screws up my login form, if my rails stack is up-to-date, or anything else.

3/ it's easy to host : Github turns out to be a fantastic, reliable and free hosting solution for static sites like that through their Github pages feature. It supports jekyll websites out of the box, but you can host any static or semi-static website with it. Hence I have a branch called "source" where I have the nanoc source for my website, and a rake task allows me to generate the compiled version and publish it on "gh-pages" (or "master" directly if it's a .github.com repository) branch. This rake task magic is what's used to generate the Github API documentation, which also uses nanoc. If some day I'm not happy with Github anymore, everything is in my local git repo and I just have to host it elsewhere.

4/ it's easy to backup : git repo, static website, no database, it speaks for itself.

5/ it allows me to focus on the content : I was already a big fan of VIM (versus full-featured IDE like Eclipse or Netbeans), and I tend to become a big fan of IA Writer, a very, very simple text editing app for MacOSX. Not having much features, buttons, menus helps you focus on the content rather than the form, the options, etc. It eliminates distractions. Nanoc (or Jekyll) is the same, I don't have to think of future-publishing, turning comments on/off, which tags should I use, etc.

6/ it allows any website structure : I'm now free again of my styles, DOM, JS framework, etc.

7/ it let me write my own helpers in Ruby if needed : it's nearly the only thing that make me not use Jekyll but Nanoc. I'm free to define helpers, which can be great for code formatting for instance, I had to do that for the Cartoque documentation.

8/ I'm not limited to blog publishing : I already prepared a notes section that I plan to use for all the technical documentation I produce everyday, which sits on my laptop and will probably be lost in 1 or 2 years. This section will be like a wiki for me. It will not interfer with blog posts section, but it will share the same workflow and benefits.

9/ it fits really well with my own workflow : most of my free time is spent in the train, where I don't have any Internet connection. The 2 tools I use most of the time are VIM and Git.

Of course you can argue that Wordpress, Typo or Radiant would do a better job in some areas. But I don't need specialist / complex things such as SEO, antispam, etc. The only thing I could miss is comments, but I'd gladly use an external service such as Disqus or Juvia (self-hosted alternative).

I hope this switch will motivate me to write more on this blog about all the technical subjects I love. Well, stay tuned :-)

EDIT(13/11/2012): fix details about github branches