Template data

The full data context exposed to templates — site, page, section, content, toc.

Every template renders against a single map. The top-level keys are documented below; nested fields follow.

.site

The merged site config (site.toml overlaid on the baseline) plus a few computed extras:

KeyTypeWhat
.site.<config>variesEvery key from site.toml
.site.tocList[TOCItem]Site-wide auto-nav (only if no nav is set)
.site.startString?URL of the conventional landing page
.site.pagesList[Map]Every page’s enriched record
.site.pagesByPathMap[String, Map]Same records, keyed by relPermalink
.site.rootMap?The root section’s _index record (or null)

.page

The current page’s enriched record:

KeyTypeWhat
.page.titleStringFrontmatter title
.page.summaryStringResolved summary (frontmatter / <!--more--> / fallback)
.page.urlStringSite-relative URL
.page.relPermalinkStringSame as url, named for Hugo parity
.page.permalinkStringAbsolute URL (baseURL + url)
.page.isSectionBooleantrue for _index.md pages
.page.parentMap?Enclosing section’s _index record
.page.ancestorsList[Map]Root → parent chain (excluding self)
.page.nextMap?Next page in section by pageOrder
.page.prevMap?Previous page in section
.page.<custom>variesAny frontmatter key

For section index pages (where .page.isSection is true), additionally:

KeyTypeWhat
.page.pagesList[Map]Non-_index siblings, sorted
.page.subsectionsList[Map]Direct child sections, sorted

.section

Always available (for non-_index pages it describes the enclosing section):

KeyTypeWhat
.section.pagesList[Map]Non-_index siblings, sorted
.section.subsectionsList[Map]Direct child sections, sorted
.section.indexMap?Section’s _index record

Other top-level

KeyTypeWhat
.contentStringRendered markdown body, HTML
.tocMap{ headings: [TocEntry] } — full heading tree
.subListChildren of the first heading, flattened

Page ordering

pageOrder is weight ascending, then name ascending. Pages with no weight frontmatter sort after weighted pages but before any sentinel value.

Note

You’ll almost always want to set explicit weight values on pages that need a particular order — installation before quickstart, etc. Anything that ships a weight lower than the default (9223372036854775807 = Long.MaxValue / 2) wins.