Skip to content

Commit 230b5ae

Browse files
devin-ai-integration[bot]bot_apkdevalog
authored
docs: document sitemap timestamps for SEO metadata page (#4608)
Co-authored-by: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com> Co-authored-by: bot_apk <apk@cognition.ai> Co-authored-by: Devin Logan <devinannlogan@gmail.com>
1 parent 7f498e8 commit 230b5ae

4 files changed

Lines changed: 41 additions & 2 deletions

File tree

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
---
2+
tags: ["seo"]
3+
---
4+
5+
## Sitemap timestamps
6+
7+
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+
<Button intent="none" outlined rightIcon="arrow-right" href="/learn/docs/seo/overview#what-fern-handles-automatically">Read the docs</Button>

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -108,6 +108,8 @@ For example, scroll to the top of this page you're visiting now and you'll see t
108108

109109
<ParamField path="last-updated" type="string" required={false}>
110110
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.
111113
</ParamField>
112114

113115
<CodeBlock title="Example last-updated">

fern/products/docs/pages/seo/metadata.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
22
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.
44
max-toc-depth: 3
55
---
66

fern/products/docs/pages/seo/overview.mdx

Lines changed: 29 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,35 @@ description: Understand Fern's built-in features for search engine optimization
66

77
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.
88

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.
33+
</llms-only>
34+
35+
## Customize your SEO
36+
37+
When you want more control, you can configure:
1038

1139
<CardGroup cols={3}>
1240
<Card title="SEO metadata" icon="fa-duotone fa-tags" href="/learn/docs/seo/setting-seo-metadata">

0 commit comments

Comments
 (0)