diff --git a/fern/products/docs/pages/changelog/2026-03-27.mdx b/fern/products/docs/pages/changelog/2026-03-27.mdx new file mode 100644 index 000000000..72fb1feef --- /dev/null +++ b/fern/products/docs/pages/changelog/2026-03-27.mdx @@ -0,0 +1,9 @@ +--- +tags: ["seo"] +--- + +## Sitemap timestamps + +Your sitemap entries now include a `` 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). + + diff --git a/fern/products/docs/pages/customization/frontmatter.mdx b/fern/products/docs/pages/customization/frontmatter.mdx index fc69aae96..90b3df9db 100644 --- a/fern/products/docs/pages/customization/frontmatter.mdx +++ b/fern/products/docs/pages/customization/frontmatter.mdx @@ -101,6 +101,8 @@ For example, scroll to the top of this page you're visiting now and you'll see t 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. diff --git a/fern/products/docs/pages/seo/metadata.mdx b/fern/products/docs/pages/seo/metadata.mdx index fbac6cf22..64ea99a27 100644 --- a/fern/products/docs/pages/seo/metadata.mdx +++ b/fern/products/docs/pages/seo/metadata.mdx @@ -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 --- diff --git a/fern/products/docs/pages/seo/overview.mdx b/fern/products/docs/pages/seo/overview.mdx index bd4398783..fec8f0079 100644 --- a/fern/products/docs/pages/seo/overview.mdx +++ b/fern/products/docs/pages/seo/overview.mdx @@ -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 `` 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. + + + 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. + + + +### 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. +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. + + +## Customize your SEO + +When you want more control, you can configure: