Frontmatter
Frontmatter is the YAML block at the top of a page. It controls page metadata, ordering, and navigation behavior.
---
title: Guides
weight: 10
hidden: false
isRoot: true
exclude: false
date: 2025-01-01
starryNight: true
---
Fields
title: page title used in navigation and<title>excerpt/description: short page description used for meta tags (alias fields; either one works)weight: ordering in navigation; lower numbers come firsthidden: hide from navigation (the 404 page andisRootpages are hidden by default). Hidden pages still render when visited directly.isRoot: marks anindexpage as a navigation rootexclude: exclude this page from build/dev; when set on a directoryindex, the whole directory is excludeddate: used for sorting when weights matchlang: language label used for the language selector; only read from directoryindex.mdxpages (including/)langCode: language code used for the HTMLlangattribute; only read from directoryindex.mdxpages (including/)starryNight: per-page code highlighting override (true,false, or options object)
Notes
isRootapplies only toindex.mdxfiles.isRootindex pages are hidden by default; sethidden: falseto show them in navigation.- Files or directories starting with
_or.are always excluded from navigation. starryNightin frontmatter overrides the globalstarryNightconfig and CLI flag.- Frontmatter is parsed using gray-matter.
Demos
Language Index Example
Add lang only on the index page of a language folder:
---
title: 简体中文
lang: 简体中文
langCode: zh
isRoot: true
hidden: true
---