Skip to content

Commit f751243

Browse files
authored
Update frontmatter docs (#786)
* Update frontmatter docs * Add some text
1 parent 298494c commit f751243

File tree

1 file changed

+30
-6
lines changed

1 file changed

+30
-6
lines changed

docs/syntax/frontmatter.md

Lines changed: 30 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,34 @@
11
# Frontmatter
22

3-
Every Markdown file referenced in the TOC may optionally define a frontmatter block. Frontmatter is YAML-formatted metadata about a page, at the beginning of each file.
3+
Every Markdown file referenced in the TOC may optionally define a frontmatter block.
4+
Frontmatter is YAML-formatted metadata about a page, at the beginning of each file
5+
and wrapped by `---` lines.
46

5-
Supported frontmatter includes:
7+
In the frontmatter block, you can define the following fields:
68

7-
| Frontmatter | Learn more |
8-
| ------------------- | --------------------------- |
9-
| `navigation_title` | See [](./titles.md) |
10-
| `applies` | See [](./applies.md) |
9+
```yaml
10+
---
11+
navigation_title: This is the navigation title <1>
12+
description: This is a description of the page <2>
13+
applies_to: <3>
14+
serverless: all
15+
---
16+
```
17+
1. [`navigation_title`](#navigation-title)
18+
2. [`description`](#description)
19+
3. [`applies_to`](#applies-to)
20+
21+
## Navigation Title
22+
See [](./titles.md)
23+
24+
## Description
25+
26+
Use the `description` frontmatter to set the description meta tag for a page.
27+
This helps search engines and social media.
28+
It also sets the `og:description` and `twitter:description` meta tags.
29+
30+
The `description` frontmatter is a string, recommended to be around 150 characters. If you don't set a `description`,
31+
it will be generated from the first few paragraphs of the page until it reaches 150 characters.
32+
33+
## Applies to
34+
See [](./applies.md)

0 commit comments

Comments
 (0)