Blog
Subscribe to the nanoc news feed and don’t miss a thing.
May 4th, 2008 ¶
nanoc 2.0.4 is out!
This minor release fixes the default html_escape function in the lib/default.rb file.
Also, the Haml filter and layout processor have been updated. It is now possible to access variables as instance variables like in any other filter or layout processor. For example:
/ The old way
%h1= h page.title
/ The new way
%h1= h @page.title
This will no doubt solve many headaches.
Enjoy!
March 31st, 2008 ¶
We’re moving the nanoc repository from Subversion to Mercurial. There are quite a few reasons for that, but it’s mostly because Mercurial is hot these days.
The new repositories are located over here. There are separate repositories for each plugin, each sample site, and of course nanoc itself.
For all the gory details, check out the development page which has been updated with lots of details on how to use Mercurial.
March 25th, 2008 ¶
nanoc 2.0.3 is out and solves a few autocompiler-related issues. Custom paths are now honored, and the autocompiler now serves files that are not compiled by nanoc with the correct MIME type.
As always, you can update simply by doing:
sudo gem update nanoc
January 26th, 2008 ¶
nanoc 2.0.2 has landed. This tiny release adds Ruby 1.8.5 compatibility, for those people whose package managers aren’t quite as up to date as they should be. Update your copy using rubygems:
sudo gem update nanoc
January 21st, 2008 ¶
nanoc 2.0.1 is out. This tiny update brings a bug fix for a rather annoying “too many open files” error which occasionally popped up during compilation and auto-compilation.
If you’ve never been bitten by this bug, go back to work. If, on the other hand, this bug is making life unbearable for you, update your copy of nanoc using rubygems:
sudo gem update nanoc
January 10th, 2008 ¶
I’ve set up a discussion group for nanoc on Google Groups. At this very moment, it’s still terribly empty, so start talking. Ask questions! Suggest features! Discuss ideas! Share patches! Cry for help! :D
December 25th, 2007 ¶
nanoc 2.0 has arrived, right in time for christmas!
In addition to nanoc 2.0, I’m also proud to present a revamped nanoc site, featuring a much less amateurish look, and most importantly, a brand new, completely rewritten manual. There are quite a few other changes, but I’m sure you’ll find those by yourself.
To update or install, simply:
sudo gem install nanoc
Before upgrading, know that there have been quite a few changes, and that some of the changes may cause your site to break. Read carefully what I have to say.
New Features ¶
In addition to defining custom filters, it is now possible to define custom layout processors. This is very similar to the new way of defining filters (see below).
Another new feature involves custom data sources. Instead of letting nanoc read the data off flat files on the hard disk, you can tell it to read from a database instead, for example. This may not sound terribly exciting, but it opens the door for writing GUI applications that manage a nanoc site. (There a no such GUI applications yet, though. Want to give it a shot?)
Quite useful are parent and children links for page objects. You can now easily get the parent of a page like @page.parent, and you can get a page’s child pages by doing @page.children. Very useful for building site maps or breadcrumb navigation, for example.
The coolest (and perhaps oddest) feature is an auto-compiler. Instead of having to manually compile your site every time you make a change, you can now let nanoc compile it whenever necessary.
Important Differences with nanoc 1.x ¶
The way custom filters are defined has changed. You can no longer use register_filter. Instead, you can write filters by subclassing Nanoc::Filter. For example, the Markdown filter looks like this now:
class MarkdownFilter < Nanoc::Filter
identifiers :markdown, :bluecloth
def run(content)
nanoc_require 'bluecloth'
::BlueCloth.new(content).to_html
end
end
The filters attribute is gone now. To define the list of filters to run before laying out a page, use the filters_pre attribute, which does exactly the same as filters.
Support for Liquid has been dropped entirely. Liquid is a nice templating system, but it’s only really useful in situations where template writers should have restricted access to variables and functions, because of security issues. Such security issues can be a problem on a live web server, but they are completely irrelevant for a nanoc-powered site.
The Erubis filter isn’t there anymore. The main reason for using Erubis is speed, but since speed is not really relevant for nanoc-powered sites, the filter has been removed.
Identical files are no longer printed which makes nanoc’s output cleaner for sites with many pages. You can use --verbose or -V (uppercase V) to let nanoc print identical files.
Templates are no longer run through ERB when creating a page. This bug feature was quite confusing, and it wasn’t really useful either.
It may not be useful to everybody, but I’d still like to mention that the nanoc source code has been completely restructured. Some parts were rewritten from scratch. The code is a lot cleaner now, so if you want to take a shot at hacking away at nanoc, now’s the time.
Compatibility with Ruby 1.9 ¶
nanoc is compatible with Ruby 1.9, which is being (or already has been) released today. (I admit I cheated a bit to make it compatible, though, but that’s not relevant.)
BlueCloth, however, does not appear to be compatible with Ruby 1.9. You’ll get a “invalid mbstring sequence” error when trying to filter a page using the markdown/bluecloth filter. To resolve this, you can use RedCloth instead of BlueCloth, since RedCloth also supports Markdown. The RedCloth filter is identified using redcloth or textile.
The nanoc site, which is available as a sample from the Mercurial repository, cannot currently be compiled because of its dependency on Hpricot, and Hpricot does not compile on Ruby 1.9.
These are only small issues, and I’m convinced that these will be fixed soon. If you rely on BlueCloth, Hpricot, or anything else that is not currently compatible with Ruby 1.9, you can still use Ruby 1.8—nanoc still works on 1.8, and it’ll stay that way for a long time.
Last Words ¶
nanoc has been tested thorougly, but there’s always a chance that something goes wrong. If you are experiencing any issues, please do do report them. They’ll be resolved in no time. Thanks a lot!
Enjoy nanoc 2.0. Merry christmas, and a happy new year.