2007-12-31: Minor release with feature enhancements. More...
2007-09-08: Small bug fix release. More...
2007-06-29: Some bug fixes and one small feature enhancement. More...
Plugin name: | File/TemplateHandler (File/DefaultHandler) |
---|---|
Author: | Thomas Leitner <t_leitner@gmx.at> |
Summary: | Handles the template files |
Parameters: | defaultTemplate: "default.template" |
Handled paths: | **/*.template |
Default Meta Information: | blocks: - - content - html useERB: true |
The template handler processes the templates found in the source directory. Templates, as the name already implies, normally specify the layout and the overall “picture” of a web page that is defined using a page file.
These files have the same format as page files – more information about this format can be found in the WebPage Format reference. The default content format for template files is HTML (contrary to page files).
The parameter defaultTemplate specifies the name of the default
template which is used when no explicit template for a page file is set via the meta information
template
. webgen assumes that the default template is in the same directory as the page file.
However, if it can not be found there, the parent directory is searched for it and so on. If a
default template isn’t found in the root directory, no template is used at all. This means that when
you create a default template in the root directory, it is used as template for all page files that
have no explicit template set.
webgen also uses the concept of a template chain to support multiple templates for one page file! For example, assume that
index.page
has set the template
meta information to special.template
,special.template
has no template
meta information set andother.page
also has no template
meta information set.The template chain for index.page
would look like this
default.template
<= special.template
<= index.page
whereas the template chain for other.page
would look like this
default.template
<= index.page
The first case also means that the special.template
is nested in the default.template
! This
makes it possible, for example, to create a general website layout and then to create a special
image gallery layout which uses the general one.
To stop the template handler from further searching for a template, you explicitly need set a null template for the page or template file:
template: ~This is useful if you want to have a different default.template
in a sub directory which should
provide a different look-and-feel for this subtree as the default.template
in the root of the
website.