Repository navigation
Fix docs routing findings from Ahrefs audit - #7889
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
📝 WalkthroughWalkthroughLocalized routing disables global alternate-link headers and enforces English-only handling for base docs. SEO tests cover canonical redirects, rewrites, and headers; the landing page links to getting-started documentation, and base docs imports use the alias path. ChangesLocalized docs routing
Estimated code review effort: 2 (Simple) | ~10 minutes Sequence Diagram(s)sequenceDiagram
participant Browser
participant Proxy
participant BaseDocsRoute
Browser->>Proxy: Request /docs/base or /de/docs/base
Proxy->>Proxy: Redirect non-English locale or rewrite canonical URL
Proxy->>BaseDocsRoute: Route /en/docs/base
BaseDocsRoute-->>Browser: Return docs response without link header
Possibly related PRs
🚥 Pre-merge checks | ✅ 24 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (24 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Greptile SummaryThis PR corrects routing and alternate-language metadata for the docs. The main changes are:
Confidence Score: 5/5This looks safe to merge.
Important Files Changed
Reviews (3): Last reviewed commit: "Strengthen alternate-link middleware cov..." | Re-trigger Greptile |
Fixes actionable internal-link and hreflang findings from the cmux Ahrefs crawl.
/docs/baseunder the shared docs layout so it exposes navigation and participates in docs searchLinkheaders from advertising unsupported/docs/basevariants that return 404/docs/getting-startedinstead of the/docsredirectValidation:
bun test tests/seo.test.tsbun run typecheckbun run build, 1,989 pages generated and 427 docs indexed/docs/base200 with 64 links and no hreflang header;/de/docs/base404; homepage has no direct/docslinkAudit: https://app.ahrefs.com/site-audit/9589643/issues?current=11-07-2026T100524
Need help on this PR? Tag
/codesmithwith what you need. Autofix is disabled.Note
Low Risk
SEO and URL middleware changes with test coverage; no auth, payments, or data-layer impact.
Overview
Addresses Ahrefs audit issues around docs URLs and hreflang by tightening locale handling for English-only pages and fixing a homepage internal link.
Routing & SEO:
alternateLinks: falsein next-intl routing stops middleware from emitting globalLinkheaders that pointed crawlers at localized/docs/baseURLs that 404. Middleware now 301-redirects/{locale}/docs/base(non-en) to unprefixed/docs/baseand rewrites/docs/baseto/en/docs/base, mirroring the existing remote-tmux pattern soAccept-Languagecannot land users on unsupported variants.Homepage: Bottom “Read the docs” CTA now targets
/docs/getting-startedinstead of/docs(redirect).Tests: SEO middleware tests assert no global
Linkheader on partially localized doc routes and correct redirect/rewrite behavior for Base docs. The Base docs page only updates import paths to@/aliases in this diff.Reviewed by Cursor Bugbot for commit dcaac94. Bugbot is set up for automated code reviews on this repo. Configure here.
Summary by cubic
Fixes Ahrefs SEO audit by canonicalizing the English-only Base docs and disabling sitewide hreflang headers to stop advertising unsupported localized URLs. The homepage now links directly to
/docs/getting-started./[locale]/docs/baseto/docs/baseand rewrite/docs/baseto/en/docs/base; page uses the shared docs layout.Linkheaders withalternateLinks: falseso unsupported locale variants aren’t advertised sitewide.Written for commit dcaac94. Summary will update on new commits.
Summary by CodeRabbit
New Features
Bug Fixes
/docs/basehas consistent canonical/locale behavior (redirecting localized requests to the correct English route and avoiding incorrect SEO headers).Tests
/docs/baseresponses, including redirect/rewrite behavior and the absence of invalid alternate-link headers.