From 55bcd5ba5be3d87098f0ba881752e59910bdd46e Mon Sep 17 00:00:00 2001 From: IanoNjuguna Date: Wed, 14 Oct 2026 14:36:56 +0300 Subject: [PATCH] fix(website): remove the hard-coded canonical link from Root MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Root.tsx rendered 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 #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 #324 --- website/src/theme/Root.tsx | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/website/src/theme/Root.tsx b/website/src/theme/Root.tsx index e88c4d1..395893f 100644 --- a/website/src/theme/Root.tsx +++ b/website/src/theme/Root.tsx @@ -6,7 +6,6 @@ import { DEVEX_SESSIONS_ENABLED } from "@site/src/components/MeetupReminderButto export default function Root({ children }: { children: ReactNode }) { const { siteConfig } = useDocusaurusContext(); - const siteUrl = siteConfig.url; useEffect(() => { // Minimal MutationObserver to fix any black text in search dropdown that CSS might miss @@ -47,7 +46,10 @@ export default function Root({ children }: { children: ReactNode }) { - + {/* No canonical link here on purpose. Docusaurus emits a per-page + for every route from siteConfig.url, and a + hard-coded one in Root — as this file used to have — replaces that + with the site root, telling crawlers every page duplicates "/". */} {children} {DEVEX_SESSIONS_ENABLED ? : null}