Fix docs canonical URLs and add missing redirects - #463
Merged
Conversation
Deploying labs-browserpod-previews with
|
| Latest commit: |
24b129f
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://27b0eee7.labs-browserpod-previews.pages.dev |
| Branch Preview URL: | https://fix-docs-canonical-and-redir.labs-browserpod-previews.pages.dev |
codingfrog27
marked this pull request as ready for review
August 31, 2026 15:13
codingfrog27
marked this pull request as draft
August 31, 2026 15:13
codingfrog27
force-pushed
the
fix/docs-canonical-and-redirects
branch
2 times, most recently
from
September 2, 2026 12:55
1c8e898 to
9b05951
Compare
codingfrog27
marked this pull request as ready for review
September 2, 2026 13:00
GabrielaReyna
requested changes
Sep 2, 2026
GabrielaReyna
left a comment
Contributor
There was a problem hiding this comment.
Thanks for working on this Merlin. I left a couple of comments, please address them and this should be ready to merge after that.
codingfrog27
force-pushed
the
fix/docs-canonical-and-redirects
branch
from
September 3, 2026 11:59
9b05951 to
0109d68
Compare
codingfrog27
force-pushed
the
fix/docs-canonical-and-redirects
branch
from
September 3, 2026 16:03
0109d68 to
24b129f
Compare
GabrielaReyna
approved these changes
Sep 4, 2026
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.
Google search console report
This PR was prompted by google search engine reported 112 pages not being indexed. Luckily, upon further inspection this seemed a lot worse than it is. Only 7 pages are real content Google declined to index. Given this and the monorepo merge being imminent, I'm now switching back to the CI cleanup. Since a lot of these issues will be easier to fix with it being in one repo. That said, I do still have a couple small fixes that should take out some entries and give small qol improvements.
The canonical URL bug
packages/astro-theme/index.tssetsbuild: { format: "file" }, so Astro emitsoverview.htmlandAstro.url.pathnamecarries the suffix throughout the build. Which in itself is not an issue since CF serves the URL extentionless and redirects the .html version to it.But we built the canonical and og:url from the Astro pathname, resulting in every doc page declaring a canonical that points to a URL that points back to itself 😅.
This is the only place where we have links with .html on it (internal links and sitemap are all extensionless). This caused 24 "page with redirect" entries.
Fix
Made canonical fallback and og:url take the
normalisedpathwhich is extensionless. Note that this is a theme change that affects all doc sites.Sitemap
The sitemap had /docs hard coded on high priority. But /docs doesn't serve the homepage, only a meta refresh tag. This is what causes the split second blank page. Since this redirect happens at html level google won't index it. So it doesn't make sense to submit it as our highest priority URL. I've removed the entry, and will add a redirect after the monorepo merge.
Post monorepo merge work
_redirects
There were also 8 doc paths that have been changed since being indexed, added them to the
_redirectsfile at first, but due to the dual deployment setup and differing roots and deployment rules between testing and production I'm saving this for after the merge.I've documented them as well but for visibility's sake the redirects will be:
/docs/tutorials/expressjs → /docs/getting-started/expressjs
/docs/tutorials → /docs/getting-started
/docs/licensing → /docs/more/licensing
/docs/guides/nginx → /docs/guides/hosting
/docs/guides/natives → /docs/guides/working-around-native-npm-dependencies
/docs/demos/PackagePod → /showcase/package-pod/
/docs/demos/SaySomething → /showcase/say-something/
/docs/demos → /showcase/
/docs/showcase → /showcase/
/docs/community → /showcase/
/docs/blog → https://labs.leaningtech.com/blog
/docs and /docs/ → /docs/overview # replaces the meta-refresh stub
Why add redirect rather than fixing our source?
Because there's no link to edit. The deprecated paths are the result of file renaming and moving. And the reference to the old URL's aren't in our repo but in googles index (plus potentially user bookmarks etc.).