Templates
Design your site with Jinja2 templates
Templates define how content becomes HTML. Hwaro uses Crinja, a Jinja2-compatible engine.
Template Directory
templates/
├── base.html # Base layout
├── page.html # Regular pages
├── section.html # Section index pages
├── index.html # Homepage (optional)
├── taxonomy.html # Taxonomy listing
├── taxonomy_term.html # Taxonomy term page
├── 404.html # Error page
└── shortcodes/ # Shortcode templates
The shortcodes/ directory contains reusable components you can embed in Markdown. See Writing: Shortcodes for usage and how to create custom shortcodes.
Template Selection
| Content | Template |
|---|---|
| content/index.md | index.html or page.html |
| content/about.md | page.html |
| content/blog/_index.md | section.html |
| content/blog/post.md | page.html |
| Taxonomy index | taxonomy.html |
| Taxonomy term | taxonomy_term.html |
Quick Example
{% extends "base.html" %}
{% block content %}
<article>
<h1>{{ page.title }}</h1>
<time>{{ page.date }}</time>
{{ content | safe }}
</article>
{% endblock %}