Fix docs canonical URLs and add missing redirects - #463
Draft
codingfrog27 wants to merge 2 commits into
Draft
Conversation
The astro-theme sets build.format: "file", so Astro.url.pathname carries a .html suffix during the build while Cloudflare serves the extensionless form as the 200. BaseHead.astro built the canonical and og:url from the raw pathname, so every docs page declared a canonical pointing at a URL that redirects back to itself. Nothing else on the site publishes those addresses, which makes the canonical tag the only reason Google has them: 24 URLs in Search Console's "Page with redirect" bucket originate here. normalisedPath already existed in the file and already stripped the suffix, added in #422 for the blog-override lookup. The fallback branch now uses it. Also: - _redirects: 301s for eight renamed docs paths confirmed 404ing in the Search Console export, plus a real 301 for the /docs meta-refresh stub. Specific rules are ordered above the .html wildcards so renamed paths resolve in one hop. - sitemap.xml.ts: stop submitting /docs/, which was listed at priority 0.8, the highest in the file, despite being a meta-refresh stub Google will never index. No URL that currently returns 200 changes behaviour.
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.
Draft for now to test out preview links. But expext to merge this week