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. By default, the page's h1 heading will be used as the title of the HTML document. If you want to use a different title, you can use front matter to specify the title of the page:

---
title: My Home Page
---

This is my **home page content**.

For example, you can use head to specify custom meta tags for Open Graph.

---
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 Front matter config for available front matter configurations, and see useFrontmatter for how to access front matter in code.