<!--
Sitemap:
- [What is Vocs](/guide/what-is-vocs): Learn what Vocs provides for documentation sites
- [Getting Started](/guide/getting-started): Install Vocs and create your first documentation site
- [Writing Docs with AI](/guide/writing-docs-with-ai): Use an AI agent to create and maintain Vocs documentation
- [Project Structure](/guide/structure): Overview of the structure of a Vocs project
- [Markdown Extensions](/guide/markdown-extensions): Features and syntax of Markdown in Vocs
- [Code & Syntax Highlighting](/guide/syntax-highlighting): Rich markup and annotations for code
- [Code Snippets](/guide/code-snippets): Include and reuse code in Markdown
- [Markdown Snippets](/guide/markdown-snippets): Include other Markdown files in MDX
- [Asset Handling](/guide/asset-handling): Manage images, fonts, icons, and other docs assets
- [Frontmatter](/guide/frontmatter): Configure page metadata, layouts, search, and UI visibility
- [Using React in Markdown](/guide/react): Compose MDX pages with React components
- [Twoslash](/guide/twoslash): Add type-aware annotations to code examples
- [Sidebar & Top Navigation](/guide/navigation): Keep docs navigation synced with routes
- [Theming](/guide/theming): Customize colors, typography, spacing, logos, and code themes
- [Tailwind CSS](/guide/tailwind): Use Tailwind utilities in Vocs pages and components
- [Layouts](/guide/layouts): Choose and customize page shells for your docs
- [Dynamic OG Images](/guide/dynamic-og-images): Generate social preview images from page metadata
- [Feedback](/guide/feedback): Collect page-level feedback from readers
- [Changelog Generation](/guide/changelog-generation): Fetch release notes and render a changelog page
- [MCP Server](/guide/mcp-server): Expose your docs and source code to AI assistants
- [AI Support](/guide/ai-support): Make your documentation easier for AI assistants to read
- [Site Configuration](/reference/site-config): Reference for options accepted by defineConfig
- [Components](/reference/components): Reference for the public React components exported from Vocs
- [Hooks](/reference/hooks): Reference for the React hooks exported from Vocs
- [Changelog](/guide/changelog): Release history for Vocs
-->

# Frontmatter \[Configure page metadata, layouts, search, and UI visibility]

Use YAML frontmatter at the top of an `.mdx` page to control page metadata, layout, and page-level UI.

```mdx
---
title: Getting Started
description: Install Vocs and ship your first docs site.
---
```

Vocs preserves custom frontmatter keys and passes them through to the page layout and MDX context, so you can also use frontmatter in your own wrappers and components.

## Common Fields

### `title`

Sets the page title used for document metadata.

```mdx
---
title: API Reference
---
```

### `description`

Sets the page description used for SEO and social sharing metadata.

```mdx
---
description: Endpoints, schemas, and examples for the Vocs API.
---
```

### `author`

Adds standard author metadata for the page.

```mdx
---
author: wevm
---
```

### `robots`

Overrides the page-level `robots` meta tag.

```mdx
---
robots: noindex, nofollow
---
```

## Layout and UI

### `layout`

Controls the page shell.

* `full`: sidebar, top nav, content, and outline
* `minimal`: top nav and centered content
* `blank`: content only

```mdx
---
layout: minimal
---
```

### `outline`

Controls the table of contents on the right side of the page.

* Set `false` to hide it.
* Set a number to enable it and limit the heading depth.

```mdx
---
outline: 2
---
```

### Visibility Toggles

These options override the defaults for the selected layout:

* `showSidebar`
* `showTopNav`
* `showLogo`
* `showSearch`
* `showAskAi`
* `showFeedback`

```mdx
---
layout: minimal
showSearch: false
showFeedback: false
---
```

## Search

### `searchPriority`

Vocs reads `searchPriority` when building the local search index.

* `0` excludes the page from search results
* higher numbers boost the page relative to other matches

```mdx
---
searchPriority: 5
---
```

## Custom Fields

You can add arbitrary frontmatter keys for your own layouts, wrappers, or components.

```mdx
---
status: beta
section: api
---
```

## Auto-Injected Fields

Vocs also adds a few fields automatically at build time:

* `filePath`: the file path relative to `src/pages`
* `lastModified`: the page's last modified date from git history, when available

These are mainly useful for built-in features such as edit links and last-updated UI, and usually should not be set manually.

## Example

```mdx
---
title: API Reference
description: Endpoints, schemas, and examples for the Vocs API.
layout: full
outline: 2
author: wevm
robots: index, follow
showAskAi: false
showFeedback: false
searchPriority: 3
status: stable
---
```
