Last updated

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:

OptionTypeDescription
excludeFromSearchbooleanExclude the page from search results and from the llms.txt file when set to true. Default: false
sidebarstringPath to the sidebars.yaml file to display as the sidebar for this page.
slugstring 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').
templatestringPath 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.

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:

OptionTypeDescription
breadcrumbsobjectToggle breadcrumbs display or prefix them with custom links.
codeSnippetobjectConfigure code snippet controls such as copy, report, expand, and collapse.
colorModeobjectToggle color mode switcher display with the hide option.
feedbackobjectCustomize or hide the sentiment feedback form at the bottom of pages.
footerobjectToggle footer display with the hide option (the only footer property available in front matter).
markdownobjectCustomize element behavior and appearance, including last updated, table of contents, and edit page.
navigationobjectCustomize the behavior and appearance of the Next page and Previous page navigation buttons.
navbarobjectToggle navbar display with the hide option (the only navbar property available in front matter).
rbacteam to role mapSet access permissions for the page. This option can contain only the map of teams to roles.
searchobjectCustomize the behavior and appearance of the Search dialog.
seoobjectConfigure SEO information in the page's <head> element.
versionPickerobjectSet the visibility of the version picker.

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