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
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.
sidebarstringPath to the sidebars.yaml file to display as the sidebar for this page.
excludeFromSearchbooleanExclude 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:

OptionTypeDescription
codeSnippetobjectConfigure code snippet controls such as copy, report, expand, and collapse.
breadcrumbsobjectToggle breadcrumbs display or prefix them with custom links.
markdownobjectCustomize element behavior and appearance, including last updated, table of contents, and edit page.
seoobjectConfigure SEO information in the page's <head> element.
navbarobjectToggle navbar display with the hide option (the only navbar property available in front matter).
footerobjectToggle footer display with the hide option (the only footer property available in front matter).
colorModeobjectToggle color mode switcher display with the hide option.
feedbackobjectCustomize 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