Repository navigation
chore(site): search crawlers skip the gmt .md twins and query URLs (northguild/gmt#559) - #29
Merged
Merged
Conversation
…orthguild/gmt#559) Googlebot and Bingbot get their own robots.txt group. It repeats every `*` rule and the Content-Signal line, and adds three Disallow lines: `/gmt/*.md$`, `/gmt/?` and `/gmt/*/?`. AI agents keep reading the `.md` twins through the `*` group, which now names Applebot too.
baldurpan
approved these changes
Nov 27, 2026
craig-o-curtis
added a commit
to northguild/gmt
that referenced
this pull request
Nov 27, 2026
…e `.md` twins and query URLs (DOX-G17, #559) (#587) 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 - **One permanent hop to a page.** A slashless page URL got a 307 from the assets binding. A 307 is temporary (RFC 9110 §15.4.8), so Google may keep the slashless URL as canonical. The Worker now turns that 307 into a 308 (RFC 9110 §15.4.9). A missing page still gets a direct 404. The old-host 301 now lands on the slash URL in one hop. - **The workers.dev copy is noindex.** `gmt-dox.northguild.workers.dev/gmt/*` answers `X-Robots-Tag: noindex`. URL Inspection showed Google treating that host as a duplicate. - **Links a page renders end in a slash.** A new `rendered-links` gate (tier `pr`, Chromium) fails a slashless page link that a mount renders at run time. `test:dist` reads only the built HTML, so it cannot catch those. The slash predicate moves to `scripts/lib/page-links.mjs`, and `test:dist` and the gate share it. - **The robots.txt policy check.** `scripts/robots-policy.mjs` checks the landing robots.txt against a policy table, using `robots-parser` 3.0.1 (pinned exactly, devDependency). Googlebot and Bingbot skip the `.md` twins and page URLs with a query. Every other agent still reads them. `deploy-smoke` checks the live file, and its slash rows expect 308. - **Runbook.** `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 - Unit tests per slice pass: worker, `dist-base`, `page-links`, `widget-pages`, gate registry and `robots-policy` (8/8). - `oxfmt --check` and oxlint pass on the changed files. - `checkRobots` on the live `https://northguild.dev/robots.txt` after northguild.dev#29 deployed: 0 failures. - **Still running:** the local full gates, `astro check`, `pnpm run validate` and the live `rendered-links` run 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.
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.
Part of northguild/gmt#559. Merge and deploy this before the gmt PR for that issue. The gmt deploy smoke checks the live robots.txt against this policy.
Why
Search Console lists about 242
.mdtwins as "Crawled – currently not indexed" and about 134?w=/?tz=permalinks as "Alternate page with proper canonical tag".noindexand the canonical tag keep them out of the index, but Google still fetches each one. That crawl is spent while 331 real pages wait in "Discovered – currently not indexed". Google's advice is to block such URLs in robots.txt, not with noindex (Crawl budget management for large sites; Managing crawling of faceted navigation URLs).What changes
A new
Googlebot+Bingbotgroup. A crawler with its own group ignores*(RFC 9309 §2.2.1), so the group repeats every*rule and theContent-Signalline. It then adds:Disallow: /gmt/*.md$: the.mdtwins;Disallow: /gmt/?: the site root with a query;Disallow: /gmt/*/?: any page path with a query. A file with a query, such as/gmt/_astro/a.png?v=1, has no/?and stays allowed.The longest match beats
Allow: /(RFC 9309 §2.2.2).Applebotis named in the*group. Apple's About Applebot says: "If robots instructions don't mention Applebot but mention Googlebot, the Apple robot will follow Googlebot instructions." Without this line, Applebot would stop reading the.mdtwins.Every other crawler, AI agents included, reads the
.mdtwins andllms*.txtas before.CLAUDE.md: the robots.txt rule now says that a change to one group is made to both.Checks
robots-policy.test.tschecks this exact file against a policy table, usingrobots-parser3.0.1. All 8 tests pass.curl -s https://northguild.dev/robots.txtshould show the new group. Search Console's robots.txt report then picks it up within 24 hours.