Front matter configuration options
Add front matter to Markdown pages to configure page-specific options. Front matter must appear at the beginning of a Markdown file in valid YAML format between triple-dashed lines (---
).
Front matter options fall into two categories:
- Options available only in page front matter
- Options that override global configurations from
redocly.yaml
Front matter-only options
These options are available exclusively in front matter:
Option | Type | Description |
---|---|---|
slug | string or [string] | Custom URL path for this page, instead of the default path based on folder and file names. Define multiple slugs to make content available at multiple URLs. Slugs can contain multiple segments (e.g., '/custom-pages/page-1'). |
template | string | Path to a custom template for the Markdown page. Omit file extensions. Use relative paths for local templates and absolute paths for templates from node modules. See Override a page template for details. |
sidebar | string | Path to the sidebars.yaml file to display as the sidebar for this page. |
excludeFromSearch | boolean | Exclude the page from search results and from the llms.txt file when set to true . Default: false |
Options that override global configuration
These options work in both front matter and redocly.yaml
. When defined in front matter, they override the global configuration:
Option | Type | Description |
---|---|---|
codeSnippet | object | Configure code snippet controls such as copy , report , expand , and collapse . |
breadcrumbs | object | Toggle breadcrumbs display or prefix them with custom links. |
markdown | object | Customize element behavior and appearance, including last updated, table of contents, and edit page. |
seo | object | Configure SEO information in the page's <head> element. |
navbar | object | Toggle navbar display with the hide option (the only navbar property available in front matter). |
footer | object | Toggle footer display with the hide option (the only footer property available in front matter). |
colorMode | object | Toggle color mode switcher display with the hide option. |
feedback | object | Customize or hide the sentiment feedback form at the bottom of pages. |
Examples
Example 1: Custom URL and page template
This configuration:
- Creates two interchangeable URL paths:
/pricing
and/subscribe
- Uses a custom blog post template
- Hides the color mode switcher
---
slug:
- /pricing
- /subscribe
template: '@theme/Templates/BlogPost'
colorMode:
hide: true
---
Example 2: SEO and component configuration
This configuration:
- Prevents search engine indexing
- Hides the report button on code snippets
- Limits table of contents to h2 headers
- Adds a "Home" link to the page breadcrumbs
---
seo:
meta:
- name: robots
content: noindex
codeSnippet:
report:
hide: true
markdown:
toc:
depth: 2
breadcrumbs:
prefixItems:
- page: index.page.tsx
label: Home
labelTranslationKey: home.title
---
Best practices
Use redocly.yaml
for most configuration settings and use front matter only for page-specific overrides.
Resources
- Override a page template
- Configure Redocly using the
redocly.yaml
file