Frontmatter
Frontmatter is a YAML data block located at the absolute top of a page. It provides a mechanism for defining page metadata and exercising fine-grained control over navigation hierarchy and sorting behavior.
---
title: Guides
weight: 10
hidden: false
isRoot: true
exclude: false
date: 2025-01-01
starryNight: true
---
Metadata Specifications
title: The page title utilized within navigation menus and the HTML<title>tag.excerpt/description: A brief summary utilized for Meta tags (these are aliases; either can be used).weight: Navigation display order; items with lower values are positioned higher.hidden: Excludes the page from navigation menus (the/404,/offline, andisRootpages are hidden by default). Hidden pages remain fully accessible via their direct URL.isRoot: Designates theindex.mdxfile as the root node for a navigation sub-tree.exclude: Completely removes the page from development and build processes. If applied to a directoryindex.mdx, the entire directory is excluded.date: Used as a secondary sorting criterion when weights are identical.lang: The display label for the language selector; only processed from directoryindex.mdxfiles (including the root/).langCode: The language code applied to the HTMLlangattribute; only processed from directoryindex.mdxfiles.starryNight: A page-level override for syntax highlighting (true,false, or a configuration object).
Key Implementation Notes
- The
isRootproperty is only applicable toindex.mdxfiles. isRootindex pages are concealed from navigation by default; sethidden: falseto force display.- Automated exclusion: Files or directories prefixed with
_or.are permanently excluded from the navigation tree. - Frontmatter settings for
starryNighttake precedence over both global configuration and CLI flags. - Frontmatter parsing is implemented via gray-matter.
Examples
Multi-language Index Configuration
Configure the lang property exclusively on the index page of each language directory:
---
title: English
lang: English
langCode: en
isRoot: true
hidden: true
---