Templating
Structure of template files
Templating content
Kask provides a series of useful, dynamic information to templates at the moment they are opened for rendering to static HTML. The struct provided to template file is called TemplateContent, which contains many fields:
- Node (sitemap item) information:
- Title of node, extracted from the source file’s name, or the
H1tag of markdown file if available. - Href for other pages to link.
- Children, which is a list of
Nodes.
- Title of node, extracted from the source file’s name, or the
- Root information:
- The root
Nodeof the website, typicallyhrefs to the/of website. This is usefull to start printing a sitemap. Just define a recursive template.
- The root
- List of stylesheets for template to include in
<head>. See Hierarchical CSS Splitting - Date in Go
time.Timetype. Useful to print the year to footer.