Repository navigation
Fix duplicate category labels serving the wrong description - #71
Merged
Merged
Conversation
Docusaurus keys a generated-index page's title/description by category label, so the how-tos Airflow, Datacoves and Snowflake pages rendered the reference / best-practices blurb, and the second of each pair got a "-1" slug (airflow-1, datacoves-1, snowflake-1). Google flagged the pairs as duplicate pages. Give the reference and best-practices categories distinct labels, pin explicit slugs on all six, and point the navbar at the new slugs. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.
Problem
Google Search Console reports "Duplicate, Google chose different canonical than user" for
docs/category/snowflake-1, and the live site shows why:Docusaurus looks up a generated-index category page's title and description by the category label (
plugin-content-docs/lib/translations.js). Three pairs of categories share a label, so both pages in each pair render the same blurb, and the second one gets a-1slug:/category/airflow+ reference/category/airflow-1/category/datacoves+ reference/category/datacoves-1/category/snowflake+ how-tos/category/snowflake-1The Snowflake navbar links were also crossed as a result: How-tos → Snowflake opened the best-practices page.
Fix
link.slug. How-tos keep the plain slugs (/category/airflow,/category/datacoves,/category/snowflake). The others become-referenceand-best-practices.snowflake→Snowflake).Docusaurus 3.8.1 rejects a
keyfield in_category_.yaml, so distinct labels are the only fix that doesn't need a framework upgrade.URL changes
/category/airflow-1,/category/datacoves-1and/category/snowflake-1now 404. Google will drop them, and they were flagged as duplicates anyway./category/snowflakenow serves the how-tos page instead of best practices. No redirects were added, because@docusaurus/plugin-client-redirectsisn't installed.Verification
npm run buildpasses. Each of the six built pages renders its own description and links only to its own section's docs (35/27/32/15/12/16 links).🤖 Generated with Claude Code