Treeplate is a set of xslt scripts for generating static websites. Authors write xhtml content by hand and provide a description of the site hierarchy. Treeplate generates the site, automatically fitting the content into boilerplate xhtml for
- headers, including stylesheet, icon, and relation links,
- footers, including author and last changed date,
- a hierarchical menu bar without scripting, like the one at left, and,
- a sitemap file for search engines.
Treeplate also adds alternating class attributes to table
class="row1"—so that they can
be coloured by a stylesheet if desired.
There is an import feature for inserting generated content, like, for
example, this manual page, and a feature for
The boilerplate generation makes it easy to experiment with specialized
support for troublesome browser software without having to manually edit
Similarly, site redesigns may only require changes to the stylesheet and
If your (planned) website is predominantly static and you prefer to create it in a text editor but you want to avoid the tedium of copy-paste-modify for the common bits, then Treeplate could be for you!
This website was generated by Treeplate.
Treeplate is released under a BSD license. It may be used and modified without restriction but no guarantees or support are offered. Nevertheless, patches, problem reports, and suggestions for improvement (in keeping with the minimalist philosophy) are welcomed.
The current version is available for download: Treeplate 1.2.2 (20090422). It is intended for unix systems and requires a Bourne shell and xsltproc. It should also work with other xslt processors and only requires xslt 1.0, xpath 1.0, and the exsl:document extension.
Treeplate requires these files and directories:
|dst||Must replicate the directory structure of
|xsltsrc||Contains the xslt scripts;
|makesite.sh||This simple shell script transforms xml files in
The sitetree.xml file
sitetree.xml file describes the hierarchical structure
of a site.
An edited extract from this website is:
<!DOCTYPE sitetree SYSTEM "sitetree.dtd"> <sitetree> <rooturl>http://www.tbrk.org</rooturl> <prefix>Timothy Bourke - </prefix> <style>basic.css</style> <icon>favicon.ico</style> <item homelink="yes" priority="1.0"> <name>Home</name> <file>index</file> <item directory="papers"> <name>Papers</name> <file>abstracts</file> </item> <item changefreq="yearly"> <name>Address</name> <file>mail</file> </item> </item> <item directory="software"> <name>Software</name> <file>index</name> <item>Treeplate</name> <file>treeplate</file> </item> </sitetree>
Two hierarchies are described: that of items as presented to visitors, and
that of the organisation on disk.
The latter may be simpler than the former and is expressed by the
The full list of item attributes is:
||describes how the files are stored on disk.|
||inserted directly into
Each item may contain other items, and must contain two elements:
||Text used in titles and menus.|
||Root name for the the source
Several settings can be set by adding the elements below to an
item, or to the
they are inherited by that branch of the hierarchy:
||Text inserted into the page title.|
||Text inserted into the page title.|
||Author name, with
||Filename of a css stylesheet.|
||Filename of a page icon.|
||Additional relation links, for instance for
||Multiple keywords can be specified, they are not inherited if the
sitetree element must contain
which is required to generate
All other generated links are relative.
The source files
The source file for this page resembles:
<!DOCTYPE sitepage SYSTEM "sitepage.dtd"> <sitepage> <title>Treeplate</title> <description>Xslt scripts for generating a static website.</description> <lastmod>$LastChangedDate: 2008-06-06 12:50:53 +1000 (Fri, 06 Jun 2008) $</lastmod> <keyword>xslt</keyword><keyword>xhtml</keyword> <content> <h1>Treeplate</h1> <p>Treeplate is a set of xslt scripts for generating static websites. ... </content> </sitepage>
The list of all possible
||The page title.
An inherited prefix or suffix can be ignored with, respectively, the
||The page description.|
||The last modified date for insertion into the footer. The $ signs, from subversion tags, are removed if present.|
||Overrides the inherited
||Optional text for insertion before the opening
||Optional additional elements for insertion into the destination
||Xhtml content for insertion into the generated page.
||Optional text for insertion after the closing
Sometimes links change when a website is rearranged.
Redirection pages can be generated by giving
redirect elements only.
The latter must have a single
href attribute containing the
Document Type Definitions are provided for the sitetree and
sitepage files, they rely on the modular
xhtml 1.0 definitions,
but validation is disabled in
makesite.sh by default.
It can be enabled by removing the
--novalid option from the