Pages
Pages are Markdown files that become HTML pages on your site. This page covers how to write content: front matter fields, Markdown syntax, and file organization. For how these fields are accessed in templates, see the Data Model.
Basic Structure
+++
title = "My Page"
date = "2024-01-15"
+++
Your content in **Markdown**.
The +++ block is TOML front matter. YAML (--- delimiters) and JSON (a top-level {...} object at the start of the file) are also supported. Content below becomes HTML.
---
title: "My Page"
date: "2024-01-15"
---
Your content in **Markdown**.
{
"title": "My Page",
"date": "2024-01-15"
}
Your content in **Markdown**.
For JSON, the first balanced {...} at the very start of the file is the front matter, and no fence is needed. The file must begin with { (no leading whitespace).
Every .md and .markdown file under content/ becomes a page, front matter or not. To keep a file out of the site (a README.md, note templates), list it in [content] ignore.
Front Matter
Required
| Field | Type | Description |
|---|---|---|
| title | string | Page title |
Common Fields
| Field | Type | Default | Description |
|---|---|---|---|
| date | string | — | Publication date: YYYY-MM-DD, optionally with time (YYYY-MM-DD HH:MM:SS or RFC 3339 datetime); unquoted TOML/YAML dates also work. A date without an offset is read in the build machine's local time zone, in TOML, YAML and JSON alike. A written UTC offset (Z, +09:00, +0900, +09, also after a space: 2024-01-15 10:00:00 +0900) is kept, so the date prints as written in both TOML and YAML. A TOML offset date also feeds date permalink tokens (:year/:month/:day) and year/month grouping as written, so a URL built in older versions from the UTC day can move (e.g. /2024/02/29/ → /2024/03/01/); add the old URL to aliases to keep it working. Any other form (a time without seconds, 20240115, a zone name such as KST, trailing text) is not a date: the build warns with the file and value and treats the page as undated |
| description | string | — | SEO description |
| draft | bool | false | Exclude from production builds |
| template | string | "page" | Template to use |
| weight | int | 0 | Sort order (lower = first) |
| image | string | — | Featured image for social sharing. A relative path naming a file in the page bundle (image = "cover.png" beside index.md) resolves to that file |
| tags | array | [] | Tag taxonomy terms. Strings and integers (tags = [2024, "crystal"]) are kept (as 2024); a float such as 3.10 is skipped with a warning, so quote it ("3.10"). Terms are NFC-normalised, so an NFD and an NFC spelling of one tag are the same term |
| categories | array | [] | Category taxonomy terms |
All Fields
| Field | Type | Description |
|---|---|---|
| updated | string | Last updated date |
| slug | string | Custom URL slug, used verbatim (not slugified). See Slugs |
| path | string | Custom URL path |
| aliases | array | Redirect URLs to this page |
| authors | array | Author IDs, matched against data/authors.* (see Site Authors) |
| toc | bool | Show table of contents |
| in_search_index | bool | Include in search |
| in_sitemap | bool | Include in sitemap |
| insert_anchor_links | bool | Add heading anchors |
| redirect_to | string | Redirect page to this URL, or to a content file given as an @/ path (@/blog/post.md) (the redirect stub is left out of the sitemap, feeds, search index and llms.txt, and of every listing: section.pages and pagination, previous/next, taxonomy terms, series, related posts, backlinks and site.authors; get_page() and site.pages still return it) |
| render | bool | Render page to output (default: true) |
| expires | date | Auto-exclude from this date on |
| series | string | Series name for grouping |
| series_weight | int | Sort order within series |
| translation_key | string | Links translations whose file names differ: pages sharing the key are translations of each other. See Translation Keys |
| menus | string / array / table | Register the page in navigation menus (menu is an alias). See Menus |
| taxonomies | table | Zola-style table of taxonomy terms ([taxonomies] with tags = [...]). See Taxonomies |
| extra | table | Custom metadata |
A field holding the wrong type (draft = "true", weight = "5", date = 20240315, categories = "News") is ignored, never coerced, and the build warns with the file and key. In particular draft = "true" is not a draft and gets published; write draft = true.
Examples
Blog Post
+++
title = "Getting Started with Crystal"
date = "2024-01-15"
description = "Learn Crystal programming basics"
tags = ["crystal", "tutorial"]
authors = ["Alice Smith"]
image = "/images/crystal-guide.png"
+++
Crystal is a fast, compiled language...
Draft
+++
title = "Work in Progress"
draft = true
+++
Not visible in production.
Build with drafts: hwaro build --drafts
Expiring Content
+++
title = "Limited Time Offer"
expires = 2025-12-31
+++
Automatically excluded from builds once the expiry date has been reached.
Build with expired content: hwaro build --include-expired
Pages expiring within 7 days generate a build warning.
Future-Dated Content
Pages with a date in the future are automatically excluded from builds. This is useful for scheduling content.
The build compares date and expires with the time the build started, as instants: a page is published when date is not after that time, and hidden when expires is not after it. A value with an offset (2024-03-05T09:00:00+09:00) means exactly that moment; a value without one, including a bare 2024-03-05, is midnight or the written time in the build machine's local time zone (so on a UTC runner a date-only page dated "today" in Seoul is still in the future until midnight UTC). Set the offset in the front matter when the schedule must not depend on where the site is built.
Quoted date and time values can include fractional seconds such as 2024-03-05 09:00:00.5, with or without a UTC offset.
+++
title = "Coming Soon"
date = 2099-01-01
+++
Published only after the date arrives.
Build with future content: hwaro build --include-future
Series Post
+++
title = "Part 1: Introduction"
series = "Crystal Tutorial"
series_weight = 1
+++
First part of the series.
With [series] enabled in config.toml, page.series_index (1-based position) and page.series_pages (all pages in the series) are computed at build time. They are template-only values, not front matter fields. See Data Model.
Custom Template
+++
title = "Landing Page"
template = "landing"
+++
Uses `templates/landing.html` instead of `page.html`.
Weighted Order
+++
title = "Introduction"
weight = 1
+++
+++
title = "Getting Started"
weight = 2
+++
Lower weight appears first.
URL Aliases
+++
title = "New Page"
aliases = ["/old-url/", "/another-old-url/"]
+++
Redirects from old URLs to this page.
Each alias is a path on this site, and the build writes a redirect stub at it.
The stub carries <meta name="robots" content="noindex"> and a
<link rel="canonical"> to the page's absolute URL (base_url + its path), so
search engines fold the old URL into the page instead of indexing the stub.
An absolute (https://example.com/old/) or protocol-relative (//example.com/old/)
value is not something this build can publish, so it is skipped with a warning.
An alias is used exactly as written, Unicode form included, so it can keep an old
URL that an older hwaro published under a decomposed (NFD) file name answering.
When an alias resolves to the same output file as a page, the page takes
precedence. This also applies to percent-encoded spellings of the file name
and to case differences on case-insensitive filesystems. An alias that names
a file (/legacy.html) where a page publishes a directory (/legacy.html/)
yields to the page the same way.
If aliases on the same page need a file and a directory at the same path
("/legacy.html" and "/legacy.html/sub/"), the first alias in aliases
is published and the build warns about the second.
Custom Metadata
+++
title = "Product Review"
[extra]
rating = 4.5
featured = true
pros = ["Fast", "Reliable"]
+++
Access in templates: {{ page.extra.rating }}
Slugs
A front matter slug is used verbatim as the last URL segment: slug = "My Post" publishes at /posts/My Post/ (percent-encoded only where a URL has to be, see URL Forms), and a / inside it adds path levels (slug = "x/y" gives /posts/x/y/). Choose an already URL-safe value. Verbatim means not slugified: like every page URL the value is still folded to Unicode NFC, which changes no character you see (see URL Forms).
Taxonomy term URLs and [[content.generate]] slugs are slugified instead, the same way as the slugify filter: ASCII letters and digits are lowercased, letters of other scripts (한글, ü) are kept, whitespace, -, _ and / become a single -, other punctuation is dropped, and leading and trailing - are trimmed. So the tag C++ Tips & Tricks lives at /tags/c-tips-tricks/, and a generated page whose slug field is A/B c_d.e lands at /<section>/a-b-c-de/. These behaviours are kept as they are so existing URLs do not move.
Full Front Matter Reference
All available fields in one block. Copy and remove what you don't need.
+++
title = "Page Title"
date = "2024-01-15"
updated = "2024-02-01"
description = "SEO description"
draft = false
template = "page"
weight = 0
slug = "custom-slug"
path = "custom/path"
aliases = ["/old-url/"]
image = "/images/cover.png"
tags = ["tag1", "tag2"]
categories = ["category1"]
authors = ["Author Name"]
toc = true
in_search_index = true
in_sitemap = true
insert_anchor_links = true
render = true
redirect_to = ""
expires = 2025-12-31
series = "Series Name"
series_weight = 1
[extra]
custom_field = "value"
+++
Content Summary
page.summary is what list pages, feeds and social cards show for a post. It is filled from the first of these sources that exists:
- The content before a
<!-- more -->marker (rendered as HTML) - The
descriptionfront matter field - An automatic excerpt cut from the rendered body
Use <!-- more --> to define a summary explicitly:
+++
title = "Long Article"
+++
This is the summary shown in listings.
<!-- more -->
The full article continues here...
The summary renders like the body: shortcodes, Markdown extensions and render hooks apply. A marker placed inside a block shortcode's body ({% note() %} … {% end %}) ends the summary inside that block, and the summary closes the block at that point. The same goes for raw HTML: a marker inside <details> … </details> (or any element left open) ends the summary there, and the summary closes the open elements, so a listing that prints it is not swallowed by an unclosed tag.
Links in a summary keep pointing where they point on the page, wherever the summary is printed: a relative link ( in a page bundle) is rooted at the page, and so is a #fragment link the summary itself does not carry ([see below](#details) aimed at a heading past the marker). A fragment inside the summary, such as a footnote reference whose note is in the summary, stays as written.
Automatic summaries
A page with neither a marker nor a description gets an automatic summary: the first 70 words of its rendered body, wrapped in a single <p> and followed by an ellipsis (…) when text was cut. The excerpt is built from the rendered HTML, so shortcodes are expanded and code blocks, headings, images and figures are skipped, so it reads as prose.
For CJK-dominant text (Chinese, Japanese, Korean), where words are not space-delimited, the limit counts characters at twice the configured number: summary_length = 70 yields up to 140 characters. Cuts land on word boundaries (character boundaries for CJK) and never split an entity or a multibyte character.
Tune or disable it in config.toml:
[content]
summary_length = 70 # words (CJK: characters ×2); 0 disables the automatic summary
summary_ellipsis = "…" # appended only when text was actually cut
page.summary_truncated is true only when the automatic excerpt was cut, so a template can show a "Read more" link only where it makes sense. Automatic summaries never replace a marker or a description; pages that have one keep their existing output.
The excerpt costs a second render of every page, so hwaro only builds it when something can print it: a template that mentions summary (or serializes whole pages, e.g. | tojson), the OG/Twitter tags, or an RSS/JSON feed. A site that shows none of them builds faster and its output is unchanged.
Markdown Syntax
Text
**bold** and *italic*
`inline code`
[link](https://example.com)

Lists
- Unordered
- Items
1. Ordered
2. Items
Code Blocks
```javascript
console.log("Hello");
```
Tables
| Header | Header |
|--------|--------|
| Cell | Cell |
Table cells support inline Markdown: bold, italic, code spans, [links](url), , and strikethrough. Links and images take the same destinations as in a paragraph: balanced parentheses ([W](https://en.wikipedia.org/wiki/Foo_(bar))), an optional title ([T](/x/ "the title")) and <angle> destinations; a backslash escapes punctuation (\*not emphasis\*). The same applies to definition list and footnote bodies.
An inline HTML tag written in a cell (<br>, <kbd>, <span class="x">) is rendered as it is in a paragraph, so one<br>two puts two lines in a cell. Text that only looks like a tag is read as one too: write Array\<Page> or use a code span to show Array<Page>. With [markdown] safe = true the tag is escaped and shows as literal text. An HTML comment in a cell is always escaped. Definition lists and footnote bodies do not render raw HTML: a tag written there is escaped whatever safe is set to.
| Feature | Example |
|----------------|----------------------------------|
| Bold | **important** |
| Italic | *emphasis* |
| Code | `config.toml` |
| Link | [Hwaro](https://example.com) |
| Image |  |
| Strikethrough | ~~deprecated~~ |
Internal Links
Use @/ to link to other content pages by their source path. Hwaro resolves these to the correct output URL at build time.
[Read the post](@/blog/my-post.md)
[About section](@/about/_index.md)
[With anchor](@/blog/my-post.md#introduction)
This is useful because you don't need to know the final URL, because Hwaro calculates it from the content path. If the target page doesn't exist, the link is left unchanged and a warning is logged during build.
@/ links are resolved in page content only (Markdown, and HTML or shortcode output inside it). Templates are not rewritten, so <a href="@/about.md"> in page.html is emitted as-is; in a template use {{ base_url }}{{ get_page(path="about.md").url }} instead.
| Syntax | Resolved URL |
|---|---|
@/blog/post.md |
/blog/post/ |
@/blog/_index.md |
/blog/ |
@/blog/post.md#section |
/blog/post/#section |
Strict mode
To fail the build instead of just warning, opt in via config.toml:
[links]
broken_internal = "error" # default: "warn"
In error mode the build collects every unresolved @/ link across all pages and fails with a single aggregated list (source.md → @/target (reason)), mapping to exit code 5 for CI. During hwaro serve the failure appears in the error overlay and the server keeps running.
Caveat with --cache: only re-rendered pages are re-checked on warm builds, so a broken link inside an unchanged page won't resurface until that page renders again. CI should run a cold build (no --cache) for a complete check.
Blockquotes
> Quote text
Admonitions
GitHub-style alert blocks render as styled callouts. Recognised types: NOTE, TIP, IMPORTANT, WARNING, CAUTION.
> [!NOTE]
> Pay attention to this paragraph.
> [!WARNING]
>
> Body can also live in its own paragraph.
> [!TIP] Custom title
> Text after the marker on the same line becomes the title (Obsidian / Hugo syntax).
The output is a <div class="admonition admonition-{type}"> with a title paragraph (<p class="admonition-title">) followed by the body. Without a custom title the type name is used (Note, Tip, …). Style it from your CSS, since Hwaro emits semantic markup only.
Tables work inside admonitions and plain blockquotes: prefix every row with > as usual (> | a | b |, > |---|---|).
Disable by setting admonitions = false under [markdown] in config.toml.
An admonition body can hold a nested blockquote (> > quoted) or another admonition (> > [!TIP]).
Limitations: there is no inline escape. Backslash-escaping (\[!NOTE\]) renders the same characters and still triggers the admonition, so disable the feature if you need to render the literal token.
Custom Heading IDs
Append {#custom-id} to a heading line to override the auto-generated slug. Useful when you want stable anchor URLs that don't break on title edits.
## Installation Guide {#install}
Renders as <h2 id="install">Installation Guide</h2>. The TOC and any [link](#install) will use the custom id.
The same syntax works on headings inside blockquotes.
Allowed id characters: letters (any script), digits, _, -, :. The id may start with a digit — {#1-create-a-project} is valid, which matters for translated numbered headings that need to keep the original anchor — but not with - or :. CommonMark allows up to 3 leading spaces before an ATX heading; deeper indentation makes the line a code block, in which case {#id} is not applied.
Disable by setting heading_ids = false under [markdown] in config.toml.
Custom heading IDs require markdown.safe = false. Under safe mode the {#id} syntax is stripped from the rendered output and no custom id is applied: the heading keeps its generated id (a raw HTML heading is no way around this, since safe mode strips raw HTML too). Writing the same {#id} twice in one page keeps it on the first heading and renames the later one with a numeric suffix (#id-1), with a build warning.
This {#id} shorthand is a special case of the more general {#id .class key=val} attribute block ([markdown] attributes = true), which also applies to inline images. See Markdown Extensions.
Definition Lists
Term
: Definition body
Another term
: Definition with **bold**, *italic*, `code`, [a link](https://example.com), and ~~strikethrough~~
: A second definition for the same term
Inline Markdown works inside both terms and definitions. Raw HTML is escaped for safety.
Asset Colocation
You can keep related assets (images, PDFs, etc.) in the same directory as your content file. This is known as a Page Bundle.
To use this feature, rename your markdown file to index.md (for regular pages) or _index.md (for section pages) and place it in a directory named after your page.
Example Structure:
content/
└── blog/
├── my-trip/
│ ├── index.md <-- The page content
│ ├── photo.jpg <-- Asset
│ └── data.json <-- Asset
└── _index.md
Hwaro will copy all non-markdown files from the page bundle directory to the output directory, maintaining the relative path. When [content.files] is configured (the hwaro init scaffolds set an image allowlist), only the files its rules allow are copied.
In your markdown, you can link to these assets using relative paths:

[Download Data](data.json)
Accessing Assets in Templates
You can access the list of colocated assets in your templates using page.assets. This returns an array of paths relative to content/ (blog/my-trip/photo.jpg).
{% for asset in page.assets %}
{% if asset is matching("[.](jpg|png)$") %}
<img src="{{ get_url(path=asset) }}" alt="Gallery Image">
{% endif %}
{% endfor %}
URL Mapping
| File | URL |
|---|---|
| content/index.md | / |
| content/about.md | /about/ |
| content/blog/post.md | /blog/post/ |
See Also
- Sections — Group related pages
- Data Model — Page properties in templates