🚧 Rspress 2.0 document is under development
close

Frontmatter

You can add front matter at the beginning of your Markdown file, which is a special part that uses YAML format to define metadata, and is included in the file's top three dashes ---.

For example, use title to specify the title of the page:

---
title: Hello world
---

You can also access properties defined in front matter in the body, for example:

---
title: Hello world
---

# {frontmatter.title}

The previously defined properties will be passed to the component as frontmatter properties. So the final output will be:

<h1>Hello world</h1>
Tip

See Front matter config for available front matter configurations.