fix(seo): canonical URLs on marketing pages + drop same-URL hreflang#17
Merged
Conversation
Only destination pages set a canonical before this. Home, /map, /best-time and the feature pages had none, so query-param variants (the map syncs week/year into the URL) risked being indexed as separate URLs. Add explicit absolute canonicals, matching the destination-page convention. Also removes the static-page hreflang alternates from the sitemap. They listed en/de/es/fr/x-default all pointing at the same URL (language is negotiated, not path-prefixed), which signals nothing to search engines. Destination clusters with genuinely distinct de/en slugs are unchanged; destinations without a German exonym now correctly emit no alternates. /compare is intentionally left out of the sitemap and uncanonicalised: it is robots noindex (content depends on the visitor's saved places). Co-Authored-By: Claude Opus 4.8 <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.
What
Canonical-tag and hreflang correctness for the marketing pages.
Canonical tags
Before this, only destination pages emitted a
<link rel="canonical">. Home,/map,/best-timeand the 7 feature pages had none./mapin particular syncsweek/yearinto the URL query string (useUrlSync), so those variants could be indexed as separate URLs. Added explicit absolute canonicals, following the existing destination-page convention (https://packedplaces.com/...). The map canonical lives in the(map)/map/layout.tsxserver layout because the page itself is a client component.Sitemap hreflang
Removed the static-page hreflang alternates. They listed
en/de/es/fr/x-defaultall pointing at the same URL (locale is negotiated, not path-prefixed), which signals nothing to search engines. Destination clusters with genuinely distinct de/en slugs are unchanged; destinations without a German exonym now correctly emit no alternates instead of a same-URL set.Intentionally not changed
/comparestays out of the sitemap and gets no canonical: it isrobots: { index: false }(content depends on the visitor's saved places). So its absence from the sitemap is correct, not a bug.Verify
npx tsc --noEmitandeslintpass on all changed files.robots.test.tspasses. (The repo's component render tests fail onReact.act is not a functiononmaintoo — a pre-existing testing-library/React env mismatch, unrelated to this PR.)