From 2117927552f0e7677759a5a159b066b2cdd6941a Mon Sep 17 00:00:00 2001 From: Chris Swithinbank Date: Tue, 23 May 2023 16:54:12 +0200 Subject: Add frontmatter reference page --- docs/src/content/docs/reference/frontmatter.md | 51 ++++++++++++++++++++++++++ 1 file changed, 51 insertions(+) create mode 100644 docs/src/content/docs/reference/frontmatter.md diff --git a/docs/src/content/docs/reference/frontmatter.md b/docs/src/content/docs/reference/frontmatter.md new file mode 100644 index 00000000..cdd2279a --- /dev/null +++ b/docs/src/content/docs/reference/frontmatter.md @@ -0,0 +1,51 @@ +--- +title: Frontmatter Reference +description: An overview of the default frontmatter fields Starlight supports. +--- + +You can customize individual Markdown and MDX pages in Starlight by setting values in their frontmatter. For example, a regular page might set `title` and `description` fields: + +```md +--- +title: About this project +description: Learn more about the project I’m working on. +--- + +Welcome to the about page! +``` + +## Frontmatter fields + +### `title` (required) + +**type:** `string` + +You must provide a title for every page. This will be displayed at the top of the page, in browser tabs, and in page metadata. + +### `description` + +**type:** `string` + +The page description is used for page metadata and will be picked up by search engines and in social media previews. + +### `editUrl` + +**type:** `string | boolean` + +Overrides the [global `editLink` config](/reference/configuration/#editlink). Set to `false` to disable the “Edit page” link for a specific page or provide an alternative URL where the content of this page is editable. + +### `head` + +**type:** [`HeadConfig[]`](/reference/configuration/#headconfig) + +You can add additional tags to your page’s `` using the `head` frontmatter field. This means you can add custom styles, metadata or other tags to a single page. Similar to the [global `head` option](/reference/configuration/#head). + +```md +--- +title: About us +head: + # Use a custom tag + - tag: title + content: Custom about title +--- +``` -- cgit