vike-vue-content

Use frontmatter to control page title, description, TOC, and navigation metadata.

Frontmatter & Metadata

Each Markdown file can declare metadata in a YAML frontmatter block at the top, controlling both rendering and navigation display.

---
title: Page Title
description: A short summary of the page.
navigation:
  label: Sidebar title
---

# Body Heading

Body content…

title & description

FieldTypeDefaultDescription
titlestringfirst # H1 in bodyPage title, used in the sidebar, prev/next navigation, and <title>.
descriptionstringPage description, displayed in the page header.

The title falls back to the first H1 when not set; description is only available when explicitly declared.

Table of contents (TOC)

The TOC is generated automatically from Markdown headings — no manual declaration. The parsed structure is exposed as page metadata and rendered by the DocsToc component:

// ContentEntry.toc
type ContentTocLink = {
  id: string          // heading anchor id
  text: string        // heading text
  depth: number       // heading level (2 = h2, 3 = h3 …)
  children?: ContentTocLink[]
}

Subheadings nest under their parent to form a tree.

The navigation field in frontmatter controls how this page appears in the sidebar:

---
title: Full page title
navigation:
  label: Short nav title
  hidden: false
---
FieldTypeDescription
navigation.labelstringOverride the sidebar display label (doesn't affect page title).
navigation.hiddenbooleanWhen true, hidden from navigation but still accessible.

Other custom fields are preserved as navigation metadata for use in your own navigation components.

Ordering

Ordering is determined by numeric prefixes on file/directory names — see Content-driven Routing. Frontmatter does not affect ordering.