A theme is a collection of templates, styles, and scripts that together provide the look and feel for a site. Themes should be placed in the site's
lib folder, and the name of the active theme directory specified in the site's configuration file.
theme = "phoenix"
Malt ships with a small selection of bundled themes including
phoenix, the default theme, and
debug, a diagnostic tool useful when designing themes or debugging sites.
Note that you can override the currently active theme with the
$ malt build --theme debug
Malt searches for a named theme first in the site's theme library, then (if it exists) in the global theme library specified by the
$MALT_THEMES environment variable. Finally it searches among the default themes bundled with Malt itself.
Malt looks for three subdirectories within the theme directory:
The content of the
resourcesdirectory is copied to the output directory during building.
Themes can bundle extensions for Malt by placing Python modules or packages in the
templatesdirectory is where Malt looks for the theme's template files.
Malt has builtin support for templates written in Jinja (using a
.jinja extension) and Ibis (using a
.ibis extension). Support for other template languages can be added via plugins.
When Malt generates a HTML page it searches for the appropriate template file in the following order, where
<type> indicates the record type in question, e.g.
Single Record page
1) <type>-single 2) single
Directory index page
1) <type>-dir-index 2) dir-index 3) index
Tag index page
1) <type>-tag-index 2) tag-index 3) index
A record can specify a custom template file to use in its header:
--- template: my-custom-template ---
Note that the file extension should be omitted from the template name.