Switching from Jekyll to nanoc
Apologies to anyone who reads my atom feed in their reader of choice. I switched this blog from Jekyll to nanoc over the weekend which caused my old posts to show up as new.
When I started this blog in 2009 I decided on Jekyll, a static site generator. Jekyll is perhaps best known for powering Github Pages, a simple way to get a site at yourname.github.com. Due to a couple small differences, I’ve grown to prefer nanoc, and decided to switch this blog.
I’m certainly not the first to convert their site from Jekyll to nanoc. It was pretty straightforward, as both programs are fairly similar. However, some rules I used made nanoc more closely emulate Jekyll.
nanoc has a blogging helper, which provides similar functionality to Jekyll’s post handling.
Unlike Jekyll, which keeps posts in
/_posts, blogging helper considers any item with a
article to be a post.
Jekyll also determines an articles’ creation time from its title.
I created the following preprocess rule to make nanoc act like Jekyll in that regard.
The other rule was for the routes of articles, for which I used this regex to make articles go in the same location as Jekyll posts. There’s probably a cleaner solution, and the regex might need adjustment for others’ use of Jekyll, but this worked quite well for me.
With these changes I was able to use all of my Jekyll posts in nanoc without modification.