Mustache Template

Variables used in the default template

Documentable the same Mustache template as base to generate every HTML page. If do not define your own in /template/main.mustache, the default one will be used.

We use Pod::To::HTML, so check it out to see the variables that have not been listed here.

Variables

Everything between {{{}}} and {{}} is considered a variable and will be replaced by Documentable.

{{{title}}}

It is replaced with the contents of =TITLE element. It will always be replaced because Documentable will throw an error if a =TITLE element is not found in all pods (see TitleNotFound).

{{subtitle}}

It is replaced with the contents of =SUBTITLE element. It will always be replaced because Documentable will throw an error if a =SUBTITLE element is not found in all pods (see SubtitleNotFound).

{{css}}

It is replaced with the path to the default CSS file location, /css/app.js. If you want to use your own CSS file in a different location, delete that variable and replace it with the new path.

{{prefix}}

It is replaced with the url-prefix entry from the configuration file. This is normally used when you want to publish your site under gh-pages or similar, or if you want to publish several versions of your docs.

If you are going to use a hardcoded URL in the template (a static image, for instance), add this variable to the beginning of the path, as follows:

 «img src="{{prefix}}/images/Camelia.svg"»«/img»
 

{{menu}}

It is replaced with the menu entries. Each menu entries has three different values:

{{submenu}}

It is replaced with the submenu entries. You can create as many of these entries using the categories entry from the config file. Each menu entries has two different values:

{{editable}}

It is replaced by "" in case the HTML page comes from a Documentable::Primary object. In any other case, it will be replaced by "none".

{{editURL}}

It is replaced by the source url of the pod. It only works with GitHub based URLs. It uses pod-root-path to build it.

{{toc}}

It is replaced with the Table of Contents, if it exists. toc-class is a special string replaced by Documentable with

{{^ toc }} no-toc{{/ toc }}

This is necessary because to reduce the generation time, Documentable creates as many base templates as possible (replacing some common variables for all pages). See softmoth/raku-Template-Mustache#36 for more information.

{{body}}

It is replaced by the pod converted to HTML. See Pod::To::HTML for more information.

{{footnotes}}

It is replaced by the footnotes converted to HTML. See Pod::To::HTML for more information.

{{podPath}}

It is replaced by the source url of the pod.