webgen 0.5.9 released
This release does not bring many new and cool features (some naturally made it into this release ;-)
but it is another step to bringing more advanced functionality like image gallery and blog support
to webgen. Since gallery and blog template files will rely heavily on embedded Ruby scripts via erb,
haml and thelike, the functionality of the context object has been expanded to allow the
programmatic inclusion of tags and the rendering of blocks.
Another important change in this release is that the naming convention for paths has been made stricter sothat it is easier to derive the (a)(l)cn from a source path.
Also note that there have been some incompatible API changes!
Changes
-
Major enhancements:
-
webgen tags can now be accessed and used via the
contextobject provided by some content processors (builder, erb, erubis, and haml).Tag handlers that do not use the
Webgen::Tag::Basemodule now need to provide one more method - see the API documentation! -
Likewise, blocks can now be rendered via the
contextobject in the same way as can be done via theblockscontent processor. -
Change in source path naming convention: only files have different parts now (sort information, basename, extension), directories and fragments not - see Source Paths Naming Convention! Also note that directories now always have a trailing slash (source paths and canonical names)!
This change may lead to unexpected behaviour if you used the sort information part or an extension in your directory names! Check this before upgrading to this version!
-
There is the new notion of passive sources which do not actively create nodes from paths but only on-demand when a to-be-resolved path is not found. This is, for example, very useful for shipping default files that can easily be overridden with custom files by putting the custom files under the to-be-resolve path in a normal source directory.
-
There is now a better system for error reporting which allows for more detailed and more specific (with path name and approximate line number) error reports.
-
-
Minor enhancements:
- Added new content processor
headfor inserting CSS/JS fragments and links into the head section of an HTML file. Arbitrarymetatags can also be inserted. - Added new content processor
tidyfor running tidy over a (most often generated) HTML file (requested by Michael Franzl). - Special characters like German umlauts and spaces are now allowed in paths (suggested by Michael Franzl). However, note that using paths with such characters may lead to problems when accessing them later on the server!
- Added new configuration option
output.do_deletionfor specifying if generated files should be deleted if their respective source is deleted (suggested by Matthias Kirschner). - Added new configuration option
tag.coderay.csswhich allows the inclusion of external stylesheets. - Added new meta information
used_nodesfor specifying dependencies for a node (suggested by Hermann Schichl). - The feed source handler now uses the passive sources system for finding its templates and does
not rely on the
feedtoolslibrary anymore (which gives a huge speedup). - The sitemap source handler now uses the passive sources system for finding its templates and dos
not rely on the
builderlibrary anymore. And the format of a*.sitemapfile is now similar to that of a*.feedfile for consistency. - The
ERB::Utilmodule is now available when using theerbcontent processor. - Directories are not created anymore if they do not contain any files.
- There is now the distinction between textual and binary content processors.
- The leading and trailing whitespace of content blocks in Webgen Page Format is not removed anymore.
- Added new content processor
-
Bug fixes:
- Fixed bug RF#25943: apply command did not work without explicitly specifying a directory
Tag::Relocatable: the resolved node is now additionally used as dependency for detecting a change- Switching on
host_osinstead ofarchfor specifying Windows specific behaviour (in preparation for the change of the Windows Ruby Installer). - Using
$?.exitstatusinstead of bit shifting to fix a JRuby issue - webgen tag handlers are now called only if all mandatory parameters are set
- Fixed
Website#renderto work when called multiple times - Fixed
Node#is_directory?to also work when called on a fragment with a trailing slash
-
Incompatible API changes:
-
Since one can now get at the parent node of a to-be-created node directly via the Path object, the interface for creating nodes has been simplified. The method
SourceHandler::Base#create_nodenow only takes a path parameter and optionally an options hash for special cases (fragment nodes and virtual nodes),SourceHandler::Base#node_existshas seen a similar change.The
create_nodesservice signature also changed. Also note that thebefore_node_createdmessage now only sends the path instead of parent and path.These changes will in most cases render custom source handlers nonfunctional! Read the API documentation and have a look at the shipped source handlers!
-
Node.absolute_namehas been removed since it has no purpose anymore!
-
-
Deprecation notes:
Path#cnbaseandPath#cnbase=are now deprecated, usePath#basenameandPath#basename=instead!Common.absolute_path(path, base)is deprecated, usePath.make_absolute(base, path)instead! Note the different parameter order!Node#absolute_cnandNode#absolute_lcnare now deprecated, useNode#acnandNode#alcninstead!
Subscribe to webgen's news feed