Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions fern/products/docs/pages/changelog/2026-03-27.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
---
tags: ["seo"]
---

## Sitemap timestamps

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).
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ [vale] reported by reviewdog 🐶
[FernStyles.Current] Avoid time-relative terms like 'now' that become outdated


<Button intent="none" outlined rightIcon="arrow-right" href="/learn/docs/seo/overview#what-fern-handles-automatically">Read the docs</Button>
2 changes: 2 additions & 0 deletions fern/products/docs/pages/customization/frontmatter.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,8 @@ For example, scroll to the top of this page you're visiting now and you'll see t

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

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.
</ParamField>

<CodeBlock title="Example last-updated">
Expand Down
2 changes: 1 addition & 1 deletion fern/products/docs/pages/seo/metadata.mdx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
title: Configure SEO metadata
description: Configure SEO metadata in Fern docs with page-level frontmatter and site-wide settings. Control titles, descriptions, and social media previews.
description: Configure SEO metadata in Fern docs with page-level frontmatter and site-wide settings. Control titles, descriptions, social media previews, and sitemap timestamps.
max-toc-depth: 3
---
<Markdown src="/snippets/agent-directive.mdx"/>
Expand Down
30 changes: 29 additions & 1 deletion fern/products/docs/pages/seo/overview.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,35 @@ description: Understand Fern's built-in features for search engine optimization

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.

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:
## What Fern handles automatically

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.

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.

<Info>
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.
</Info>

<llms-only>
### Sitemap implementation details

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.

On each publish, the system:
1. Resolves each page to its URL slug from the navigation tree.
2. Computes a SHA-256 hash of each page's normalized markdown content.
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

📝 [vale] reported by reviewdog 🐶
[FernStyles.Acronyms] 'SHA' has no definition.

3. Compares hashes against stored values — only changed or new pages are upserted, and stale entries are cleaned up.
4. Changelog entries map to their parent changelog page's slug since they render on a single page with hash fragments.

Normalization strips whitespace, copyright symbols, and capitalization before hashing to avoid false-positive change detection from trivial formatting differences.

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.
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

📝 [vale] reported by reviewdog 🐶
[FernStyles.Adverbs] Remove 'gracefully' if it's not important to the meaning of the statement.

</llms-only>

## Customize your SEO
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

📝 [vale] reported by reviewdog 🐶
[FernStyles.Headings] 'Customize your SEO' should use sentence-style capitalization.


When you want more control, you can configure:

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