Template Variables
When the exporter processes a page it generates a dictionary with variables that can be used in Pandoc templates. The dictionary is written into the YAML entry sx
of the markdown page.
- sx.navindex - The index generated from published pages with the menu attribute. The variable is a list of records with the following members:
- id - The Zim id of the page.
- display - The value of the menu attribute of the page.
- link - A link to the page. The link is relative to the page that is being exported.
- items - The list of items of a submenu. Exists only when a submenu exists.
- sx.tr - The dictionary with the translated template variables.
- sx.res - The dictionary with page-relative paths to custom resurce files from the layout used by the template.
- sx.home - A link to the home page. The link is relative to the page that is being exported. The value is calculated from the home attribute in the configuration.
- sx.main-css - A link to the main CSS. The link is relative to the page that is being exported.
- sx.meta-title - The metaTitle (attribute) of the page with added titlePrefix and titleSuffix (configuration).
- sx.news-activeitems: Generated for pages of type 'news' and contains the list of page's children that are published and not expired. Each child is described with a dictionary:
- id - The Zim id of the page.
- title - The title of the page.
- link - A link to the child page. The link is relative to the page that is being exported.
- brief - The brief text (excerpt) of the child page.
- date - The date the page was published.
Other entries in sx
are the variables from the original page that were not redefined by the exporter.