> For AI agents: the complete documentation index is available at https://rspress.rs/llms.txt, the full documentation bundle is available at https://rspress.rs/llms-full.txt.

# Frontmatter

You can add frontmatter at the beginning of a Markdown file. It is a [YAML](https://yaml.org/) block wrapped with three dashes `---` and used to define metadata.

For example, use [title](https://rspress.rs/api/config/config-frontmatter.md#title) to specify the page title. By default, Rspress uses the page's H1 heading as the HTML document title. To use a different title, set it in frontmatter:

```mdx
---
title: My Homepage
---

This is my **homepage content**.
```

You can also use [description](https://rspress.rs/api/config/config-frontmatter.md#description) to specify a custom page description. By default, Rspress extracts the first contentful paragraph below the `h1` heading as the description (see [How description is determined](https://rspress.rs/guide/advanced/custom-head.md#how-description-is-determined)). If the extracted result does not meet your needs, you can override it:

```mdx
---
description: A brief introduction to my homepage for SEO and social sharing.
---
```

For example, you can use [head](https://rspress.rs/api/config/config-frontmatter.md#head) to specify custom meta tags for [Open Graph](https://ogp.me/).

```yaml
---
head:
  - - meta
    - property: og:url
      content: https://example.com/foo/
  - - meta
    - property: og:image
      content: https://example.com/bar.jpg
# - - [htmlTag]
#   - [attributeName]: [attributeValue]
#     [attributeName]: [attributeValue]
---
```

:::tip
See [Frontmatter config](https://rspress.rs/api/config/config-frontmatter.md) for available frontmatter options, and [useFrontmatter](https://rspress.rs/ui/hooks/use-frontmatter.md) for accessing frontmatter in code.
:::
