Skip to main content

Theme engine

The organization site themes are rendered with Jinja2. Theme files are uploaded as theme assets.

Basic Jinja syntax:

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

Pages in this section:

Theme structure

A theme's files are organised in folders, and the folder decides the role of the 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

Themes contain text files only: images are uploaded to the organization's media library and picked from the settings.