Example 11: Include Templates

Key Concepts

Key concepts: Context Iteration Pipeline

The badges above were rendered using options = ["inline"]. Each badge corresponds to one section in data/concepts.toml, rendered through blocks/concept-badge.html and placed inline within the surrounding text.

Context
Each item's fields are available as tokens inside the template, scoped to that item. Tokens from other steps resolve using the original page context, not the iteration context.
Iteration
The template step iterates over each context — TOML section or directory subdirectory — rendering the template once per item and concatenating the results.
Pipeline
Template rendering is one step in the processing pipeline. Tokens that the template step does not own remain in the output as literals, resolved by subsequent steps using page context.

Both the badges and this definition list come from data/concepts.toml — the same data source used twice with different templates (concept-badge.html for inline badges, concept-list-item.html for definitions).