🚧 Rspress 2.0 document is under development
close

Frontmatter

You can add front matter at the beginning of your Markdown file. It is a YAML block wrapped by the three dashes --- and is used to define metadata.

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 properties defined above are passed to the component as frontmatter. So the final output will be:

<h1>Hello world</h1>
Tip

See Front matter config for available front matter configurations.