Putting a "last modified on/at" line on your site

As of nanoc 1.6, page objects have a 'file' attribute (at least if you're using the filesystem data source), which is a File object for the uncompiled page. You can use this to get the last modified date/time, like this:

<p>This page was last updated at <%= @page.file.mtime %>.</p>

which could be compiled to

<p>This page was last modified at Mon Oct 01 15:57:30 +0200 2007.</p>

A nicely-formatted timestamp can be obtained by using the following code:

<%= page.file.mtime.strftime("%A %B %d, %Y at %H:%M:%S %Z") %>

Which would yield something like:

"Wednesday December 19, 2007 at 02:45:42 CST"