Repository navigation
fix(dox): one permanent hop to each page, and search crawlers skip the .md twins and query URLs (DOX-G17, #559) - #587
Conversation
…e `.md` twins and query URLs (DOX-G17, #559) - The Worker turns the assets binding's trailing-slash 307 into a 308, and the old-host 301 lands on the slash URL. The workers.dev copy answers X-Robots-Tag: noindex. - A new `rendered-links` gate, tier pr, fails a slashless page link that a mount renders at run time. The slash predicate moves to scripts/lib/page-links.mjs, shared with test:dist. - robots-policy.mjs checks the landing robots.txt against a policy table with robots-parser 3.0.1. deploy-smoke checks the live file, and its slash rows expect 308. - The Cloudflare runbook gains the Search Console steps and the pages to inspect again.
baldurpan
left a comment
There was a problem hiding this comment.
Looks good at 803dcad. permanentSlash turns a 307 into a 308 only when it is the same origin, the same path plus / and the same query; other responses pass through. The old-host 301 adds the slash through withPageSlash and leaves dotted paths alone. _redirects lists both the slash and the slashless form, so the moved-page rules still match after the hop. I checked the robots rules against robots-parser 3.0.1: the .md twins are blocked, query URLs get the treatment the policy table expects, and the OG images stay crawlable. The X-Robots-Tag: noindex stays on the twins, which covers the case where something is blocked but still indexed. The five dox-g17 specs match the code. worker/index.test.ts wouldn't load locally because the generated corpus-counts module was missing, so CI's run is the one that counts there. When I approved, 51 checks had passed and the Dox browser tests were still pending.
…ks, close DOX-G17 (#559) (#588) Follow-up to #587, which merged the DOX-G17 work for #559. The final gate run found three small defects after that merge. This PR fixes them and closes the story. ## Fixes - **deploy-smoke:** the slash rows 6a and 6b now run in the local smoke (`DOX_SMOKE_LOCAL`) as well as live. `wrangler dev` answers a slashless page with the same 307 as production, so the Worker's 308 can be checked before a deploy. Both rows read the function page from the local sitemap. - **rendered-links:** the gate now waits for `settle` before it reads the links, as `tier-2-gates.md` describes. - **robots-policy.test.ts:** drops its `vitest` import. The Vitest globals are on, and the test rules forbid importing them. ## Close-out - Tracker: DOX-G17 is Done. Its spec folder is removed, along with its line in `specs/index.md`. - Two docs went over their size budget, so each is split: - The Search Console steps and the pages to inspect again move to `context/dox/search-console-runbook.md`. - The gate runner and CI jobs move to `context/dox/built/tier-2-runner-and-ci.md`. The index entries and the one inbound link are updated. ## Validation - `deploy-smoke` passes live against production. It also passes locally under `wrangler dev`, where `/gmt/reference` returns 308. - The `robots-policy`, `page-links` and gate-registry tests pass (96). - `node scripts/verdict.mjs validate` passes all 27 checks. It ran before the two doc splits, so CI is the check for those. - `oxfmt --check` and oxlint are clean, and `/optimize` reports no finding from this story. No `packages/` file changes, so there is no changeset.
Closes #559.
Merge order: northguild/northguild.dev#29 (the robots.txt) is merged and deployed. This PR's deploy smoke checks that live file.
Why
Search Console lists 887 URLs as not indexed. Most are URLs we never want indexed, and Google keeps fetching them while 331 real pages wait in "Discovered – currently not indexed".
What changes
gmt-dox.northguild.workers.dev/gmt/*answersX-Robots-Tag: noindex. URL Inspection showed Google treating that host as a duplicate.rendered-linksgate (tierpr, Chromium) fails a slashless page link that a mount renders at run time.test:distreads only the built HTML, so it cannot catch those. The slash predicate moves toscripts/lib/page-links.mjs, andtest:distand the gate share it.scripts/robots-policy.mjschecks the landing robots.txt against a policy table, usingrobots-parser3.0.1 (pinned exactly, devDependency). Googlebot and Bingbot skip the.mdtwins and page URLs with a query. Every other agent still reads them.deploy-smokechecks the live file, and its slash rows expect 308.cloudflare-runbook.md§4 has the Search Console steps after deploy, the timeline and the nine pages to inspect again.No
packages/change, so no changeset.Validation
dist-base,page-links,widget-pages, gate registry androbots-policy(8/8).oxfmt --checkand oxlint pass on the changed files.checkRobotson the livehttps://northguild.dev/robots.txtafter northguild.dev#29 deployed: 0 failures.astro check,pnpm run validateand the liverendered-linksrun against a built site, plus this PR's CI. A closing commit follows that sets the tracker to Done and removes the story's spec folder.