From 3324c95694496091cfacc01c10d982c4bd70e8ce Mon Sep 17 00:00:00 2001 From: Taras Mankovski Date: Wed, 30 Sep 2026 07:52:00 -0400 Subject: [PATCH] =?UTF-8?q?=F0=9F=90=9B=20Say=20that=20this=20site=20lives?= =?UTF-8?q?=20at=20frontside.com/graphgen?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit frontside.com proxies this site and serves the same pages, so the two origins are duplicates of each other. Nothing said which one is the original: the docs emitted no canonical at all, and the deploy staticalized with `--base=https://graphgen-data.netlify.app`, so every link and every sitemap entry named the hosting url rather than the one readers visit. Two identical sites and no signal is how they end up competing for the same searches instead of counting as one page. Neither origin has a robots.txt either, so nothing else settles it. The docs pages now name the url they are read at, built from the request so that a local crawl still names localhost. staticalize 0.3.1 rewrites it onto `--canonical` while the rest of the build stays on `--base`, so the Netlify copy remains readable on its own and its sitemap still says so. Only `routes/docs/[...slug].tsx` needs it: `index.tsx` is a 307 with no markup, and `[name].tsx` is not in the sitemap. staticalize comes from npm rather than jsr. Deno's minimum dependency age refuses a jsr version for its first 24 hours, and both deploy jobs run this task, so a jsr specifier would fail every deploy on the day of a release. npm resolution is not subject to it. The package publishes a `bin` rather than a `/cli` export, so the specifier loses its subpath. 0.3.1 also restored the default for `--retries`, so the flag 0.3.0 forced us to pass goes away with it. thefrontside/effection#1255 and thefrontside/interactors#333 make the same move; `fix-static-css.ts` only rewrites Twind css in html and is unaffected. --- deno.json | 2 +- www/routes/docs/[...slug].tsx | 7 +++++++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/deno.json b/deno.json index 02e8a8a..cbb1ec5 100644 --- a/deno.json +++ b/deno.json @@ -13,7 +13,7 @@ "build:cli": "cd cli && deno task build:cli", "dev": "cd www && deno run -A dev.ts", "start": "cd www && deno run -A main.ts", - "staticalize": "deno run -A jsr:@frontside/staticalize@0.3.0/cli --site http://localhost:8000 --output=built --base=https://graphgen-data.netlify.app --retries=3 && deno run -A fix-static-css.ts" + "staticalize": "deno run -A npm:staticalize@0.3.1 --site http://localhost:8000 --output=built --base=https://graphgen-data.netlify.app --canonical=https://frontside.com/graphgen && deno run -A fix-static-css.ts" }, "lint": { "rules": { diff --git a/www/routes/docs/[...slug].tsx b/www/routes/docs/[...slug].tsx index ccc09f0..73f96a9 100644 --- a/www/routes/docs/[...slug].tsx +++ b/www/routes/docs/[...slug].tsx @@ -63,12 +63,19 @@ export default function DocsPage(props: PageProps) { description = String(props.data.page.data.description); } + // The page a reader actually arrives at, so that this copy and the one + // frontside.com serves are one page rather than two competing for the same + // searches. Built from the request, which staticalize rewrites onto + // `--canonical` while the rest of the build stays on `--base`. + let canonical = new URL(props.url.pathname, props.url.origin).href; + return ( <> {props.data.page?.title ?? "Not Found"} | graphgen docs {description && } +