Hey everybody!
webgen 0.5.9 has just been released! If you don’t know what webgen is,
read the “What’s webgen?” section down below.
This announcement is also available at
http://webgen.rubyforge.org/news/release_0_5_9.html
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
context
object
provided by some content processors (builder, erb,
erubis, and haml).Tag handlers that do not use the
Webgen::Tag::Base
module now
need to provide one more method - see the API documentation! -
Likewise, blocks can now be rendered via the
context
object in
the same way as can be done via theblocks
content 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
head
for inserting CSS/JS
fragments and links into the head section of an HTML file.
Arbitrarymeta
tags can also be inserted. -
Added new content processor
tidy
for 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_deletion
for
specifying if generated files should be deleted if their respective
source is deleted (suggested by Matthias Kirschner). -
Added new configuration option
tag.coderay.css
which allows
the inclusion of external stylesheets. -
Added new meta information
used_nodes
for 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 thefeedtools
library
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 thebuilder
library
anymore. And the format of a*.sitemap
file is now similar to
that of a*.feed
file for consistency. -
The
ERB::Util
module is now available when using theerb
content 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.
-
-
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_os
instead ofarch
for specifying Windows
specific behaviour (in preparation for the change of the Windows
Ruby Installer). -
Using
$?.exitstatus
instead of bit shifting to fix a JRuby issue -
webgen tag handlers are now called only if all mandatory parameters
are set -
Fixed
Website#render
to 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 methodSourceHandler::Base#create_node
now
only takes a path parameter and optionally an options hash for
special cases (fragment nodes and virtual nodes),
SourceHandler::Base#node_exists
has seen a similar change.The
create_nodes
service signature also changed. Also note that
thebefore_node_created
message 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_name
has been removed since it has no purpose
anymore!
-
-
Deprecation notes:
-
Path#cnbase
andPath#cnbase=
are now deprecated, use
Path#basename
andPath#basename=
instead! -
Common.absolute_path(path, base)
is deprecated, use
Path.make_absolute(base, path)
instead! Note the different
parameter order! -
Node#absolute_cn
andNode#absolute_lcn
are now deprecated, use
Node#acn
andNode#alcn
instead!
-
What’s webgen?
webgen is a tool to generate static websites by combining content
with template files. You create one or more template files in which
you define the layout of your page and where the content should go.
After that you create page files in which you only define the
content. You can use a variety of markup languages like Textile or
Markdown or Haml to define your content and you can add dynamic parts
via ERB or by using webgen tags. This allows the automatic generation
of menus, breadcrumb trails and much more!
Installation
gem install webgen