Front matter
Configure where page dates come from, and set front matter for many pages at once with cascade.
Dates#
[frontmatter] lists, for each date, where to look, in order:
[frontmatter]
date = ["date", "publishDate", "pubdate", "published", "lastmod", "modified"]
lastmod = [":git", "lastmod", "modified", "date", "publishDate", "pubdate", "published"]
publishDate = ["publishDate", "pubdate", "published", "date"]
expiryDate = ["expiryDate", "unpublishdate"]frontmatter:
date:
- date
- publishDate
- pubdate
- published
- lastmod
- modified
expiryDate:
- expiryDate
- unpublishdate
lastmod:
- :git
- lastmod
- modified
- date
- publishDate
- pubdate
- published
publishDate:
- publishDate
- pubdate
- published
- date{
"frontmatter": {
"date": [
"date",
"publishDate",
"pubdate",
"published",
"lastmod",
"modified"
],
"expiryDate": [
"expiryDate",
"unpublishdate"
],
"lastmod": [
":git",
"lastmod",
"modified",
"date",
"publishDate",
"pubdate",
"published"
],
"publishDate": [
"publishDate",
"pubdate",
"published",
"date"
]
}
}These are the defaults. A list you set replaces the default list; the first source that has a date wins.
- A front matter field name
- That field:
date,published, or any other. :filename- The date at the start of the file or bundle name:
2026-10-02-my-post.mdgives the date and the slugmy-post. :fileModTime- The file’s modification time.
:git- The author date of the file’s last Git commit, with
enableGitInfo. Without it, or for a file Git does not know, it gives no date andlastmodfalls through to the next source.
:default in a list stands for the default list of that date.
Cascade#
cascade in the configuration sets front matter on every page it matches:
[[cascade]]
[cascade.params]
banner = "images/docs-banner.jpg"
[cascade.target]
path = "/docs/**"
kind = "page"cascade:
- params:
banner: images/docs-banner.jpg
target:
kind: page
path: /docs/**{
"cascade": [
{
"params": {
"banner": "images/docs-banner.jpg"
},
"target": {
"kind": "page",
"path": "/docs/**"
}
}
]
}target selects pages by path (a glob), kind, lang and environment. A page’s own front matter wins over a cascade; a section’s cascade (in its _index.md) applies to the pages below it. See Front matter.