Every field available to templates as the dot context, with the conditions under which each is populated
Every template, component, and partial receives one *RouteData value as its dot context (.). This page lists every field on it and on the types reachable from it, in the order the Go structs declare them. The source of truth is internal/engine/types_route.go and types_page.go; a test in internal/engine fails when a field is added to the structs without an entry here.
RouteData and Page are built from embedded groups, and html/template promotes embedded fields, so address them flat: .Lang, not .RouteI18n.Lang; .Page.Title, not .Page.PageIdentity.Title.
Reading this page
The Set when column on the RouteData tables says when a field holds a value. Everywhere else, assume the field is populated whenever its parent is. The conditions come from BuildRouteData in internal/template/routedata.go.
Value
Meaning
always
Set on every render
collection
The page belongs to a collection (.Collection is non-nil)
sidebar layout
The layout is docs, wide, or labs
list page
The page is a collection _index.md
versioned
The collection has versioning.enabled: true
tabbed
Sidebar layout and the collection uses docs tabs
labs
The collection is a labs collection
plugins
Never set by the engine; plugins fill it in BeforeRender
A nil pointer is false in {{ if }} but panics on field access, so guard optional pointers with with:
HTML
{{ with .Paginator }}Page {{ .Current }} of {{ .Total }}{{ end }}
Page embeds the groups below, so their fields are addressed as .Page.<Field>. Sidebar and TOC are named fields, addressed as .Page.Sidebar.<Field> and .Page.TOC.<Field>.
PageIdentity
Field
Type
Description
.Page.Title
string
Page title, after inference from the first heading or filename
.Page.Slug
string
URL slug
.Page.Date
time.Time
Publish date. Zero when unknown; test with .IsZero
.Page.Updated
time.Time
Last-updated date
.Page.PublishDate
time.Time
Scheduled publish date
.Page.ExpiryDate
time.Time
Expiry date
.Page.Permalink
string
Final URL of the page; use this in links
.Page.RelPermalink
string
Root-relative form of the URL
.Page.Kind
NodeKind
home, section, page, bundle, standalone, taxonomy, or term
.Page.FilePath
string
Source file path
.Page.RelPath
string
Source path relative to content/
A time.Time is never false in {{ if }}, so guard dates explicitly:
HTML
{{ if not .Page.Date.IsZero }}<timedatetime="{{ .Page.Date.Format "2006-01-02"}}">{{ .Page.Date.Format "January 2, 2006" }}</time>{{ end }}
PageContent
Field
Type
Description
.Page.Content
template.HTML
Rendered body
.Page.Summary
template.HTML
Rendered summary
.Page.RawContent
string
Markdown source of the body
.Page.WordCount
int
Words in the body
.Page.ReadingTime
int
Estimated reading time in minutes
.Page.Headings
[]Heading
Headings extracted for the table of contents
.Page.HasCodeBlocks
bool
True when the body contains a fenced code block
.Page.HasImages
bool
True when the body contains an image
.Page.FrontmatterLines
int
Height of the frontmatter block, for line-number offsets
Internal, not for templates: ContentDigest and FrontmatterDigest are hashes used by incremental rebuilds.
PageMeta
Field
Type
Description
.Page.Draft
bool
True for draft: true pages
.Page.Description
string
Page description
.Page.Image
string
Cover image from the image frontmatter field
.Page.DateExplicit
bool
True when Date came from frontmatter or a YYYY-MM-DD filename prefix rather than file modification time. Check it before presenting a date as editorial content
PageRelationships
Field
Type
Description
.Page.Collection
*Collection
Owning collection
.Page.Section
*Section
Owning section
.Page.PrevPage
*Page
Previous page in collection order
.Page.NextPage
*Page
Next page in collection order
.Page.Siblings
[]*Page
Pages in the same section
.Page.Backlinks
[]*Page
Pages that link to this one
PageTaxonomy
Field
Type
Description
.Page.Tags
[]string
Tags
.Page.Categories
[]string
Categories
.Page.Aliases
[]string
Redirect aliases
.Page.Extra
map[string][]string
Custom taxonomies keyed by name, for example authors
PageSidebar (.Page.Sidebar)
Sidebar presentation settings for this page. This is not the navigation tree; that is .Sidebar on RouteData.
Field
Type
Description
.Page.Sidebar.Order
int
Sort order
.Page.Sidebar.Label
string
Label override
.Page.Sidebar.Hidden
bool
Hidden from the sidebar
.Page.Sidebar.Attrs
map[string]string
Extra attributes on the sidebar link
.Page.Sidebar.Badge
Badge
Badge next to the label
.Page.Sidebar.Icon
string
Icon name
PageTOC (.Page.TOC)
Field
Type
Description
.Page.TOC.Enabled
*bool
Per-page override; nil means inherit
.Page.TOC.MinLevel
int
Lowest heading level to include
.Page.TOC.MaxLevel
int
Highest heading level to include
PageI18n
Field
Type
Description
.Page.Lang
string
Language code
.Page.LangRelPath
string
Source path relative to the language root
.Page.Translations
[]*Page
The same page in other languages
.Page.AllTranslations
[]*Page
All language variants including fallbacks
.Page.IsFallback
bool
True when this render is a fallback copy from the default language
PageVersioning
Field
Type
Description
.Page.Version
string
Version ID
.Page.VersionRelPath
string
Source path relative to the version root
.Page.VersionPeers
[]*Page
The same page in other versions
Direct fields and methods
Field
Type
Description
.Page.ShowTags
*bool
Per-page show_tags override; nil means inherit
.Page.NavNode
*NavNode
This page's node in the sidebar tree
.Page.Resources
[]Resource
Files bundled with the page
.Page.Params
map[string]any
The params frontmatter block plus engine-set keys
Method
Returns
Description
.Page.URL
string
Permalink when set, otherwise RelPermalink
.Page.ShowUpdated
bool
Whether to show the updated date, from show_updated frontmatter (default true). Display only; Updated is always resolved
SiteContext (.Site)
Field
Type
Description
.Site.Title
string
Site title
.Site.BaseURL
string
Absolute base URL
.Site.BasePath
string
Normalized base path: /docs/ or /
.Site.SiteID
string
Site identifier
.Site.Language
string
Default language code
.Site.Generator
string
Generator string for the meta tag
.Site.Favicon
string
Favicon URL
.Site.FaviconType
string
Favicon MIME type
.Site.Logo
LogoContext
Resolved site logo
.Site.SitemapEnabled
bool
True when the sitemap plugin is on
.Site.Config
any
The full sarde.yaml, a *config.SiteConfig at runtime. See below
.Site.Collections
map[string]*Collection
Collections by name
.Site.Taxonomies
map[string]*Taxonomy
Taxonomies by name
.Site.TaxonomiesByLang
map[string]map[string]*Taxonomy
Taxonomies per language
.Site.Pages
[]*Page
Every page in the site
.Site.Data
map[string]any
Contents of the data/ directory
.Site.BuildTime
time.Time
Build timestamp
.Site.Languages
[]Language
Configured languages
.Site.DefaultLang
string
Default language code
.Site.EditURL
string
Base URL for "edit this page" links
.Site.KazariScriptURL
string
URL of the Kazari interaction script
.Site.IconLicenses
[]IconLicense
License metadata of loaded icon sets, for a credits page
.Site.Config is typed any in Go to avoid an import cycle, and holds the parsed configuration at runtime. Templates read it directly, so {{ .Site.Config.Footer.Text }} works, but a misspelled section fails at render time rather than at config load. The sections the default theme reads:
{{ if .Children }}{{ template "navlist" . }}{{ end }}
</li>
{{ end }}
</ul>
{{ end }}
{{ with .Sidebar }}{{ template "navlist" .Root }}{{ end }}
→ A nested list of every sidebar entry, with the current page marked active and its ancestors marked open.
GlobalNav and GlobalNavItem
GlobalNav has one field, Items, a slice of GlobalNavItem.
Field
Type
Description
Label
string
Link text
URL
string
Link target
Collection
string
Collection name the item represents, if any
IsActive
bool
The current page is inside this item
External
bool
The target is off-site
BreadcrumbItem
Field
Type
Description
Label
string
Crumb text
URL
string
Crumb target
Current
bool
This crumb is the current page
PaginationLinks and PaginationLink
PaginationLinks has Prev and Next, each a *PaginationLink with URL and Title. Either side may be nil.
Paginator
Field
Type
Description
Pages
[]PaginationLink
Numbered links, one per page of results
CurrentPages
[]*Page
Content pages visible on this pagination page
Current
int
1-based index of the current page
Total
int
Total number of pagination pages
HasPrev
bool
A previous page exists
HasNext
bool
A next page exists
PrevURL
string
URL of the previous page
NextURL
string
URL of the next page
TotalItems
int
Content items across all pages
BaseURL
string
Collection base URL for building custom links
FirstURL
string
URL of the first page
LastURL
string
URL of the last page
Pages holds the numbered links, not the content. The content for the current page is CurrentPages. Page 1 lives at the collection URL and page N at <collection>/page/N/.
HTML
{{ $pages := .Collection.Pages }}
{{ with .Paginator }}{{ $pages = .CurrentPages }}{{ end }}
{{ if .HasPrev }}<ahref="{{ .PrevURL }}">Newer</a>{{ end }}
<span>{{ .Current }} / {{ .Total }}</span>
{{ if .HasNext }}<ahref="{{ .NextURL }}">Older</a>{{ end }}
</nav>
{{ end }}
→ On a paginated list, the current slice of posts and prev/next links; on an unpaginated list, every post and no nav.
Taxonomy types
Taxonomy
Field
Type
Description
Name
string
Plural name, for example tags
Singular
string
Singular name
Terms
map[string]*TaxonomyTerm
Terms by slug
Permalink
string
URL of the taxonomy list page
PaginateBy
int
Items per term page; 0 means no pagination
TaxonomyTerm
Field
Type
Description
Name
string
Term as written in frontmatter
Slug
string
URL slug
CustomSlug
string
Slug from the permalink field in data/*.yml, overriding the generated one
Permalink
string
URL of the term page
Pages
[]*Page
Pages carrying the term
Label
string
Display label from data/*.yml
Description
string
Description from data/*.yml
Color
string
Color from data/*.yml
Icon
string
Icon from data/*.yml
Hidden
bool
Hide from listings
Priority
int
Sort priority
Difficulty
string
beginner, intermediate, or advanced
ContentType
string
lecture, lab, assignment, project, reference, tutorial, or assessment
TermEntry
Embeds *TaxonomyTerm, so every field above (Name, Slug, CustomSlug, Permalink, Pages, Label, Description, Color, Icon, Hidden, Priority, Difficulty, ContentType) is available directly, plus:
Field
Type
Description
Count
int
Number of pages carrying the term
PopTier
int
Popularity quintile from 1 to 5, for tag-cloud sizing
Homepage types
HomepageData and HeroData
HomepageData has Template (the homepage template name) and Hero.
→ One link per configured language, with the current one marked.
VersionLink
Field
Type
Description
ID
string
Version ID
Label
string
Display label
URL
string
Peer page or version root, depending on the redirect strategy
Title
string
Title of the target page
IsCurrent
bool
This is the version being rendered
IsLatest
bool
This is the last_version
Banner
string
none, unmaintained, or unreleased
Redirect
string
same-page or root
Heading
Field
Type
Description
Level
int
Heading level, 1 to 6
ID
string
Anchor ID
Text
string
Heading text
Resource
Field
Type
Description
Name
string
File name
Title
string
Title
MediaType
string
MIME type
RelPermalink
string
URL of the file
Width
int
Image width, 0 when unknown
Height
int
Image height, 0 when unknown
Internal, not for templates: SrcPath is the absolute path on the build machine.
Badge
Field
Type
Description
Text
string
Badge text
Variant
BadgeVariant
default, note, tip, success, caution, or danger
Method
Returns
Description
IsEmpty
bool
No text set
CSSClass
string
sarde-badge-<variant>, for example sarde-badge-tip
PageBanner
Field
Type
Description
Content
string
Banner text
Variant
string
note, tip, caution, or danger; defaults to note
Icon
string
Lucide icon name overriding the variant's default
ThemeConfig (.Theme)
Field
Type
Description
Name
string
Theme name
Slug
string
Theme slug
Version
string
Theme version
Author
string
Theme author
Tokens
map[string]string
Resolved light-mode tokens
DarkTokens
map[string]string
Resolved dark-mode tokens
DarkEnabled
bool
Dark mode is on
StyleTag
template.HTML
Pre-rendered <style> block with the token custom properties
LayoutType and NodeKind
.Layout is one of default, docs, splash, wide, full, centered, split, presentation, or labs. Sidebar layouts are docs, wide, and labs; table-of-contents layouts are docs and labs.
.Page.Kind is one of home, section, page, bundle, standalone, taxonomy, or term.