Skip to content

Commit 024d972

Browse files
Document special characters in frontmatter (#3462)
Co-authored-by: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com> Co-authored-by: Devin Logan <devinannlogan@gmail.com>
1 parent d677840 commit 024d972

1 file changed

Lines changed: 18 additions & 2 deletions

File tree

fern/products/docs/pages/customization/frontmatter.mdx

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,13 @@ subtitle: Set titles, add meta descriptions, and more
44
description: Use frontmatter to set a variety of page properties and metadata.
55
---
66

7-
You can optionally use frontmatter to set each page's title, full slug override, meta description, a URL to suggest edits to the page, and its OpenGraph image. You can also use frontmatter to disable certain page elements like the table of contents, on-page feedback, and page actions. For advanced styling and functionality customizations beyond frontmatter options, see [custom CSS and JavaScript](/docs/customization/custom-css-js).
7+
You can optionally use frontmatter to set each page's title, full slug override, meta description, a URL to suggest edits to the page, and its OpenGraph image. You can also use frontmatter to disable certain page elements like the table of contents, on-page feedback, and page actions.
8+
9+
<Tip>
10+
For advanced styling and functionality customizations beyond frontmatter options, see [custom CSS and JavaScript](/docs/customization/custom-css-js).
11+
</Tip>
12+
13+
## Frontmatter syntax
814

915
Frontmatter must be added to the top of a `.md` or `.mdx` file, before the rest of the content. Use sets of three dashes to indicate the beginning and end of your frontmatter, as shown:
1016

@@ -22,7 +28,17 @@ og:title: SEO Metadata Title
2228
```
2329
</CodeBlock>
2430

25-
## Title
31+
### Special characters
32+
33+
Frontmatter uses YAML syntax, but values are also processed as MDX. Some characters need quoting, while others need backslash escaping.
34+
35+
| Characters | Solution | Example |
36+
|------------|----------|---------|
37+
| `:` `#` `&` `*` `!` `%` | Wrap in quotes | `title: "OAuth: A guide"` |
38+
| `{` `}` `<` `>` | Escape with `\` | `title: "Using \<Callout\>"` |
39+
| `"` `'` | Opposite style or `\` | `title: 'The "best" practices'` |
40+
41+
## Title
2642

2743
<ParamField path="title" type="string" required={false} default="Page name from docs.yml">
2844
Sets the page's [`<title>` element](https://web.dev/learn/html/document-structure#document_title). This appears in browser tabs, bookmarks, and search results.

0 commit comments

Comments
 (0)