Frontmatter

What is frontmatter

Frontmatter is a block of YAML at the very top of a markdown file, between two --- lines. It tells moss about the page — its title, date, visibility, and more.

---
title: My First Post
date: 2024-06-15
description: A short summary for search engines and list previews.
---

The rest of the file is your content.

Frontmatter is optional. A file without it still becomes a page — moss uses the filename as the title.

Identity

These fields describe what the page is.

FieldTypeDefaultDescription
titlestringfilenamePage title
descriptionstringSEO meta description and list previews
datestringPublication date (YYYY-MM-DD)
tagslistContent tags
langstringauto-detectedLanguage override ("en", "zh-hans", "zh-hant")

These fields control how the page appears in the site's navigation and chrome.

FieldTypeDefaultDescription
navbooleantrue for root pagesShow in header navigation
weightintegerSort order in nav and lists (lower = first)
breadcrumbbooleansite defaultShow breadcrumb trail on this page
footerbooleansite defaultShow footer on this page

Visibility

FieldTypeDefaultDescription
draftbooleanfalseSkip generation entirely
unlistedbooleanfalseGenerate but hide from lists and sitemap

Children

These fields control how a folder page displays its child pages.

FieldTypeDefaultDescription
childrenbooleantrueShow child page list on section pages
children_stylestring"list""list", "card", or "summary"
children_groupstring"none"Group by "year" or "none"
children_depthstring"direct""direct" (immediate children) or "all" (all descendants)
children_sourcestringWikilink to folder whose children to show instead

Card layout uses the cover image from each child's frontmatter.

Media

FieldTypeDefaultDescription
coverstringCover image path for card layouts and page headers
cover_typestringauto-detected"image", "video", or "iframe"
logostringLogo image displayed in the site header

See media > Cover images for details.

Cross-listing

FieldTypeDefaultDescription
also_inlistFolder paths where this article also appears in child lists
seriesbool/listSeries declaration — group related articles in reading order

also_in makes an article appear in multiple sections without duplicating the file:

---
title: Building a Trellis
also_in:
  - projects
  - featured
---

Advanced

FieldTypeDefaultDescription
cascademapPush values to all descendant pages
urlstringfrom file pathCustom URL override
translationKeystringLink files as translations of each other
uidstringauto-generatedContent-addressable ID
layoutstringautoTemplate: "page" or "article"
sidebarstringWikilink to a folder to use as sidebar navigation
review_ofstringURL of the work being reviewed
ratingintegerRating (1–5) for reviews
commentsbooleantrueShow comments section

Cascade

cascade pushes frontmatter values to all descendants, so you don't repeat them on every file:

---
title: Documentation
cascade:
  breadcrumb: true
  comments: false
---

Every page nested under this one inherits these values unless it overrides them in its own frontmatter.

Published with moss