Improve Website Indexing#9716
Merged
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR improves SEO indexing for the documentation site by ensuring search engines treat the latest stable version of docs as canonical, while excluding older versions from indexing and the sitemap.
Changes:
- Adds
canonical,noindex, andog:urlsupport tocreateMetadata, and setsmetadataBasein the root layout. - Marks non-latest doc pages with
noindexand points their canonical URL to the corresponding latest-version page; blog posts emit a self-canonical URL. - Builds the latest-version map dynamically in the sitemap (replacing the hardcoded
DOCS_DISALLOWEDregex) and extendsrobots.txtto disallow all older HotChocolate/Fusion/StrawberryShake versions.
Reviewed changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| website/public/robots.txt | Disallows all non-latest doc version paths from crawlers. |
| website/lib/metadata.ts | Adds optional canonicalUrl, pageUrl, and noIndex fields and applies them to the generated Metadata. |
| website/app/layout.tsx | Sets metadataBase so relative metadata URLs resolve to the site URL. |
| website/app/sitemap.ts | Replaces hardcoded disallow regexes with dynamic per-product latestStableVersion filtering. |
| website/app/docs/[...slug]/page.tsx | Computes canonicalUrl, pageUrl, and noIndex based on whether the doc page is on the latest version. |
| website/app/blog/[...slug]/page.tsx | Sets self-canonical and og:url on individual blog posts. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.