nanoc 2.2 has arrived. This release contains a handful of new features. nanoc 2.2 is not quite as big as 2.1 was, and it is mostly backward compatible.
nanoc commands now inherit from Cri::Command instead of Nanoc::CLI::Command. Cri (Commandline Ruby Interface or something) is a library for building commandline applications that was derived from nanoc’s commandline interface. If you have custom commands defined in your site, you will need to update them to inherit from Cri::Command instead.
The compile command now takes --pages and --assets commandline switches which tell the compiler to only compile pages or assets (very useful if you have a lot of assets and only want to recompile some pages).
Windows users may find the new --no-color commandline switch useful. This switch disables ANSI color codes, which should make nanoc’s terminal output a lot nicer to read.
The compiler now compiles all pages and assets by default—not just outdated ones. In other words, the --all switch is on by default. To compile only outdated pages, use --only-outdated. nanoc’s algorithm for finding out which pages/assets are outdated simply isn’t smart enough (yet).
Stack traces are a lot more informative now. When an exception occurs, the stack trace will show the exact page/asset/layout and line number where the error happened.
When laying out a page, the current layout is accessible through the new @layout variable.
The Blogging helper’s atom_feed method now takes new :content_proc, :excerpt_proc and :articles parameters. This allows atom feeds to be constructed with a custom set of articles, or atom feeds where the excerpt is automatically generated based on the content, etc. See the Blogging helper documentation for more information.
There is a new Rainpress filter, which compresses CSS using the Rainpress library.
The LinkTo helper has a new relative_path_to function, which generates a relative path to the given page/asset or path. This may not be very useful by itself, but the new RelativizePaths filter, which makes all paths in all HTML and CSS files relative, should be quite useful for those who want to deploy their site in subdirectory instead of at the root of a web site.
Last, but not least, the new Filtering helper allows parts of a page to be filtered. Check out the Filtering helper documentation for details. Here’s an example of how it could be used:
<% filter :rubypants do %>
Here’s some text…
<% end %>
You can, as always, update your copy of nanoc by issuing the "gem update" command, like this:
% gem update nanoc
If you have any issues with this nanoc release, do let me know on the mailinglist or on the IRC channel. Enjoy!