Nesta 0.9.13 released
Version 0.9.13 has been released. New features include support for Erb templates (in the views folder only, not for pages) and a nesta edit command that makes it easier to edit your site. Etag support is enabled in new projects.There have also been a few internal API tweaks to support the plugins that are starting to spring up. Two view helper methods (url_for and base_url) have been removed.
There have been a few contributors to this release (thanks all). Max Sadrieh has been particularly helpful by digging through the list of outstanding issues, submitting patches, and generally getting stuck in. :-)
Upgrading
If your project (or theme) contains any templates that use the url_for or base_url helpers, you’ll need to replace them with a call to the url helper from Sinatra. It’s automatically available to you within your templates, and takes a path. For example:
%a{ :href => url(page.path) }= page.heading
If you’ve copied the atom.haml or sitemap.haml files from the default set into your views folder, they’ll need updating (if you haven’t actually changed them just delete them, and Nesta will find them in the gem itself).
The changes
Here’s the CHANGES file with the full list of updates:
-
The nesta script has a new command; edit. You can pass it the path to a file within your
content/pagesfolder and it will open the file in your default editor (as set by theEDITORenvironment variable). -
The nesta script has a new option;
--bash-completion. Run nesta with this option and it will print some Bash that will configure command line completion for the nesta command.You can type
nesta edit <TAB>and Bash will complete the names of the files in yourcontent/pagesdirectory. :-)Installation instructions at the top of the Bash script.
-
Nesta can now be mounted cleanly at a path, rather than at a site’s root, and assets and links will be served correctly. (Max Sadrieh, Graham Ashton)
-
The default
config.rufile that is generated when you create a new project now enables Etag HTTP headers. (Max Sadrieh) -
Two helper methods have been removed;
url_forandbase_url. Use Sinatra’surlhelper instead. They would have been deprecated rather than removed, but if you try and load Nesta’s helpers in a Rails appurl_forbreaks Rails’s rendering. (Max Sadrieh, Graham Ashton) -
The
current_item?helper has been created inNesta::Navigation. You can override it to implement your own logic for determining whether or not a menu item rendered by the menu helpers are considered to be “current”. (Chad Ostrowski) -
The
Pageclass has a new method;body_markup. It can be overridden by a plugin, and is used by the foldable plugin. (Micah Chalmer) -
The
FileModelclass has a new method;parse_metadata. It can be overriden by plugins that implement an alternate metadata syntax. Used by the yaml-metadata plugin. -
Erb templates in your
./viewsfolder, or in a theme’s folder, will now be found when you call Sinatra’s erb helper method. -
config.ymlcan now contain Erb (and therefore inline Ruby), which will be interpreted when loaded. (Glenn Gillen) -
Extended the
nestacommand to support new commands that could (for example) be added by a plugin. The class to be instantiated within theNesta::Commandsmodule is determined from the command line argument (e.g.nesta plugin:createwill instantiate the class calledNesta::Commands::Plugin::Create). -
Bug fix: Don’t crash if a page’s metadata only contains the key, with no corresponding value. You could argue this wasn’t a bug, but the error message was difficult to trace. See #77.
-
Bug fix: Summaries on Haml pages were not marked up as paragraphs. See #75.
I really hope I haven’t forgotten anybody. Let me know if I have and I’ll update the post/CHANGES file…