wok

Templates

Content is then rendered using Jinja2 templates. Templates can have any extension, and that extension will carry over to the generated files. So if you want to generate an html file, then your default template would be named default.html, and be in the templates directory.

To choose what template a content file should use, specify the type metadata field. For more information, see the section on content.

Various variables relating to the site and the current page are provided to the template system. For example:

{% extends "base.html" %}

{% block content %}
    <h1>{{ page.title }}</h1>
    {{ page.content }}
{% endblock %}

There are two main objects available to the templater: site, and page. These variables, and the following attributes, are guaranteed to exist, and be decently well formed, unless otherwise noted.

site

page

Each of these may be set or overwritten in the YAML header on each content file, unless otherwise stated.