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
Your sitemap entries now include a `<lastmod>` timestamp that's invisible to readers and used exclusively by search engines to prioritize crawling recently updated pages. Timestamps update only when a page's content actually changes — trivial formatting differences like whitespace or capitalization are ignored. This follows [Google's sitemap best practices](https://developers.google.com/search/docs/crawling-indexing/sitemaps/build-sitemap).
8
+
9
+
<Buttonintent="none"outlinedrightIcon="arrow-right"href="/learn/docs/seo/overview#what-fern-handles-automatically">Read the docs</Button>
Displays a "Last updated" timestamp in the page footer. Use this to show readers when the content was last modified. The value is displayed as-is, so you can use any date format you prefer.
111
+
112
+
This field is separate from the timestamps in your [sitemap](/learn/docs/seo/overview#what-fern-handles-automatically), which are managed automatically and used exclusively by search engines.
Copy file name to clipboardExpand all lines: fern/products/docs/pages/seo/metadata.mdx
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,6 +1,6 @@
1
1
---
2
2
title: Configure SEO metadata
3
-
description: Configure SEO metadata in Fern docs with page-level frontmatter and site-wide settings. Control titles, descriptions, and social media previews.
3
+
description: Configure SEO metadata in Fern docs with page-level frontmatter and site-wide settings. Control titles, descriptions, social media previews, and sitemap timestamps.
Copy file name to clipboardExpand all lines: fern/products/docs/pages/seo/overview.mdx
+29-1Lines changed: 29 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -6,7 +6,35 @@ description: Understand Fern's built-in features for search engine optimization
6
6
7
7
Fern optimizes your documentation for both traditional search engines and AI-powered tools out of the box. SEO ensures your pages rank well in Google, Bing, and other search engines, while GEO (Generative Engine Optimization) ensures AI tools like ChatGPT, Claude, and Cursor can efficiently consume and reference your content.
8
8
9
-
Out of the box, Fern generates meta tags, social previews, canonical URLs, and clean slugs for every page — including AI-optimized content via [`llms.txt`](/learn/docs/ai-features/llms-txt). When you want more control, you can customize:
9
+
## What Fern handles automatically
10
+
11
+
Without any configuration, Fern generates meta tags, social previews, canonical URLs, clean slugs, and AI-optimized content via [`llms.txt`](/learn/docs/ai-features/llms-txt) for every page.
12
+
13
+
Fern also generates a `sitemap.xml` for your documentation site that follows [Google's sitemap best practices](https://developers.google.com/search/docs/crawling-indexing/sitemaps/build-sitemap). Each page entry includes a `<lastmod>` timestamp that updates only when the page's content actually changes. Trivial formatting differences like whitespace or capitalization are ignored. These timestamps are invisible to readers and used exclusively by search engines to prioritize crawling recently updated pages.
14
+
15
+
<Info>
16
+
Sitemap timestamps are separate from the [`last-updated` frontmatter field](/learn/docs/configuration/page-level-settings#last-updated), which displays a visible date in the page footer for readers.
17
+
</Info>
18
+
19
+
<llms-only>
20
+
### Sitemap implementation details
21
+
22
+
Fern tracks content changes using two internal tables: one for URL slugs and one for markdown source files. Multiple source files (e.g., changelog entries) can map to a single slug.
23
+
24
+
On each publish, the system:
25
+
1. Resolves each page to its URL slug from the navigation tree.
26
+
2. Computes a SHA-256 hash of each page's normalized markdown content.
27
+
3. Compares hashes against stored values — only changed or new pages are upserted, and stale entries are cleaned up.
28
+
4. Changelog entries map to their parent changelog page's slug since they render on a single page with hash fragments.
29
+
30
+
Normalization strips whitespace, copyright symbols, and capitalization before hashing to avoid false-positive change detection from trivial formatting differences.
31
+
32
+
The sitemap route fetches stored slug data, builds a URL-to-timestamp lookup, and adds the timestamp to each sitemap XML entry. If no data exists for a domain yet, the sitemap omits timestamps gracefully rather than failing.
0 commit comments