Skip to main content

Theme engine

The organization site is rendered with Jinja2 templates. Basic syntax:

{{ variable }}                       {# print a value #}
{{ object.attribute }} {# attribute access #}
{{ object['key'] }} {# key access #}
{% if condition %}...{% endif %}
{% for item in list %}...{% endfor %}
{{ value | filter }}

In this section:

Theme structure​

The folder decides the role of a file:

pathrole
manifest.jsonname, identifier, version, author
layout/*.htmlthe whole HTML document, with content_for_layout
sections/*.htmlcomposable blocks, each with its own {% schema %}
snippets/*.htmlreusable fragments, included with {% include %}
templates/*.jsonpage composition: which sections, in which order
templates/**/*.htmlpages that are not composable, such as the supporter area
config/settings_schema.jsonwhich global settings the theme exposes
config/settings_data.jsonthe values of those settings
assets/*CSS, JavaScript, fonts

A theme contains only text files: images are uploaded to the organization's media library and picked from the settings.