Templates
Thermite uses Tera for templating. If you've used Jinja2 or Nunjucks, you already know Tera.
Variables
Every template gets these variables:
Site-level (from thermite.toml)
| Variable | Source |
|---|---|
site_title | title |
site_description | description |
base_url | base_url |
Plus any [extra] keys, injected by name.
Page-level (from frontmatter + content)
| Variable | Description |
|---|---|
title | Page title |
content | Rendered HTML — use {{ content | safe }} |
content_raw | Original Markdown source |
date | Display date (no time component) |
date_raw | Original date string from frontmatter |
description | Page description |
tags | Tag array |
url | Page URL path |
og_image | Page or site-level OG image |
og_type | "article" for dated non-index, "website" otherwise |
canonical_url | base_url + url |
Page list
| Variable | Description |
|---|---|
pages | Array of other pages (dated, non-index only) |
Each entry: title, date, date_raw, url, description.
Note:
pagesonly includes pages with adatethat aren'tindex.md. Undated pages still build — they just don't appear in the list.
Example
A minimal base.html:
<!DOCTYPE html>
<html>
<head>
<title>{{ "{% block title %}" }}{{ site_title }}{{ "{% endblock %}" }}</title>
</head>
<body>
{{ "{% block content %}{% endblock %}" }}
</body>
</html>
A page.html extending it:
{{ "{% extends \"base.html\" %}" }}
{{ "{% block title %}" }}{{ "{{ title }}" }} — {{ "{{ site_title }}" }}{{ "{% endblock %}" }}
{{ "{% block content %}" }}
<h1>{{ "{{ title }}" }}</h1>
{{ "{{ content | safe }}" }}
{{ "{% endblock %}" }}
Markdown
Thermite uses pulldown-cmark with these extensions:
- Tables — pipe syntax
- Footnotes —
[^1]references Strikethrough— double tildes- Task lists —
- [ ]and- [x] - Heading attributes —
# Title {#custom-id}
Standard Markdown (links, images, code blocks, blockquotes, lists) works as expected.