You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: fern/products/docs/pages/seo/metadata.mdx
+47-5Lines changed: 47 additions & 5 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -3,20 +3,62 @@ title: Configure SEO metadata
3
3
description: Configure SEO metadata at the page or site level.
4
4
---
5
5
6
-
Configure SEO metadata at the page or site level to improve search visibility and social media previews for your documentation. Keep titles between 50-60 characters and descriptions between 150-160 characters for optimal display.
6
+
Fern automatically generates all SEO metadata for every page in your documentation site. Search engines and social media previews work out of the box with no configuration required.
7
+
8
+
When you do want to customize SEO settings, you can set defaults [at the site level](#website-metadata) or override them on [individual pages](#page-level-configuration). Keep titles between 50-60 characters and descriptions between 150-160 characters for optimal display.
7
9
8
10
<Note>
9
11
The metadata configurations on this page are for SEO and social tags that aren't visible to users. For visible footer links, see [footer links configuration](/learn/docs/configuration/what-is-docs-yml#footer-links-configuration).
10
12
</Note>
11
13
12
-
## Page metadata
14
+
## How it works
13
15
14
-
Set SEO properties in each page's [frontmatter](/docs/configuration/page-level-settings) to control how individual pages appear in search results and social media shares. Page-level metadata takes precedence over site-wide settings.
16
+
Fern looks for metadata values in this order:
15
17
16
-
<Markdownsrc="/snippets/seo-metadata-page.mdx" />
18
+
1.**Page frontmatter** - Custom SEO values for a specific page
19
+
2.**Site-level `docs.yml`** - Default SEO values for all pages
20
+
3.**Automatic defaults** - Generated from your page's existing title, description, etc.
21
+
22
+
<Infotitle="Example">
23
+
`og:image` is the image that appears in social media previews. If you don't set `og:image` in a page's frontmatter, Fern uses the site-wide `og:image` from `docs.yml`. If neither is configured, the tag is omitted entirely.
24
+
</Info>
25
+
26
+
27
+
## What Fern automatically generates
28
+
29
+
For every page, Fern creates these SEO tags in your HTML:
30
+
31
+
<AccordionGroup>
32
+
<Accordiontitle="HTML meta tags">
33
+
-`<title>` tag with site-wide suffix (e.g., "Page Title | Your Site Name")
34
+
- Meta description (pulled from your `description`, `subtitle`, or `excerpt` fields)
35
+
- Meta keywords (when you provide them)
36
+
- Canonical URL (from your page slug or `canonical-url` override)
37
+
- Robots meta tags (`noindex`/`nofollow` when configured)
-`twitter:title`, `twitter:description`, `twitter:image` - What appears in Twitter/X previews
49
+
-`twitter:site`, `twitter:creator` - Your Twitter handles
50
+
-`twitter:card` - Card type (e.g., "summary_large_image")
51
+
</Accordion>
52
+
</AccordionGroup>
17
53
18
54
## Website metadata
19
55
20
-
Define default SEO properties for your entire documentation site in your [`docs.yml` file](/docs/configuration/what-is-docs-yml). These settings apply to all pages unless overridden by page-specific metadata.
56
+
Set default SEO metadata for your entire documentation site in [`docs.yml`](/docs/configuration/what-is-docs-yml). These settings apply to all pages unless overridden by page-specific metadata.
21
57
22
58
<Markdownsrc="/snippets/seo-metadata-site.mdx" />
59
+
60
+
## Page-level configuration
61
+
62
+
Configure SEO metadata in your page's [frontmatter](/docs/configuration/page-level-settings) to control how individual pages appear in search results and social media shares. These settings override site-wide settings.
0 commit comments