Repository navigation
fix(website): remove the hard-coded canonical link from Root - #331
Merged
Merged
Conversation
Root.tsx rendered <link rel="canonical" href={siteConfig.url} /> for every
route, which tells crawlers that every page duplicates the site root.
Docusaurus already emits its own per-page canonical from siteConfig.url, and
it replaces Root's tag during render: on the current build, 0 of 112 pages
contain the hard-coded form and every page canonicalises to its own URL. The
symptom in IntersectMBO#324 is therefore not reproducible on the deployed site, so this
change is deliberately subtractive rather than a reimplementation — adding
another canonical would leave two tags per page.
The tag is removed anyway because it is a trap: if the per-page canonical ever
stops overriding it, every page silently points at "/" again. The unused
siteUrl goes with it, and a comment records why it must not come back.
Verified after the change: 112 pages, exactly one canonical each, 0 pointing
at the root except the homepage, 15 pointing at a client-redirect target
(session renumbering stubs) and the rest at themselves. tsc --noEmit and the
production build both pass.
Refs IntersectMBO#324
danbaruka
approved these changes
Oct 16, 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.
Description
Removes the hard-coded canonical link from
website/src/theme/Root.tsx:The reported symptom does not reproduce on the current site. Measured against production just now:
Each page canonicalizes to itself, which is the "Expected" section of #324. Docusaurus emits its own per-page
<link rel="canonical">fromsiteConfig.url(rendered withdata-rh="true"), and it replaces the Root tag during render. Scanning the production build of the currentmain: 0 of 112 pages contain the form the issue quotes, and every page has exactly one canonical.So the tag is dead code — but it is a loaded one, which is why this PR removes it rather than leaving it: if that replacement ever stops winning (a Docusaurus change, another swizzle, a different render order), every page in the site silently points at
/again, which is precisely the bug described. The diff is therefore subtractive: the tag and its now-unusedsiteUrl, plus a comment recording why it must not come back.Timeline for context: the hard-coded tag came in with
7cec515("Update Docusaurus configuration with sitemap settings and metadata enhancements"), before the SEO/metadata work in #138 gave the site correct per-page canonicals. The issue was most likely written from reading the source, which is fair — the line was and is visible there.This PR deliberately does not add a canonical implementation of its own: doing so would produce two
rel="canonical"tags per page, which is worse than one correct one.Fixes #324
Type of Change
Testing
onBrokenLinks: "throw"andonBrokenAnchors: "throw", and passestsc --noEmitpasses. Production build passes. Full build-output scan after the change:The 15 differing pages canonicalize to their redirect target, which is correct behaviour for a redirect stub — e.g.
/docs/working-group/q2-2026/sessions/18-ai-dev-workflow/session-notes/→.../18-cardano-ai-dev-workflow/session-notes/, and/docs/how-to-guide/beginner/howtocreateaddress/→.../beginner/address/.Before/after comparison is behaviour-identical, which is the point of the exercise: removing the tag changes nothing that crawlers see today, it removes the path back to the broken state.
Notes for review
404.htmlcarriesrel="canonical"pointing athttps://devex.intersectmbo.org/404.html/— a nonsense URL (trailingSlash: trueappending a slash to a file). Harmless in practice since a 404 should not be indexed, but worth a separate look if you want it clean./docs/working-group/q2-2026/sessions/18-ai-dev-workflow/...and19-…/20-…exist because of the Q2 session renumbering; nothing broken, just noted.og:*andtwitter:*tags in the same<Head>are untouched.Checklist