Theme templates
Some files in a theme are simply copied in the destination folder, while others are used as templates to generate the destination file. Normally, the .html
, .css
, and .js
files are used as templates.
The template engine used is Velocity. You can read the Velocity User Guide here, and the language reference here. Some useful tools are included in Gianadda:
- the EscapeTool ($esc),
- the DateTool ($date),
- the ComparisonDateTool (also $date),
- the MathTool ($math)
Objects specific to Gianadda
The following Gianadda objects are accessible from within a template:
$base
: a relative path to the root of the website. Very handy to build URLs to site-level files such as CSS or JavaScript files.$outputFile
: output file name and path$outputDir
: output directory where the output file is being written,- $conf: an object giving access to the settings,
- $folder: the current folder (for a site-level template, this the root folder),
- $pic: the picture being processed (only available to the preview template)
To see examples of templates, you can have a look a the source files for the default theme, most notably folder/index.html.