Skip to content

chore(site): search crawlers skip the gmt .md twins and query URLs (northguild/gmt#559) - #29

Merged
craig-o-curtis merged 1 commit into
mainfrom
chore/559-search-crawler-robots
Nov 27, 2026
Merged

craig-o-curtis merged 1 commit into
mainfrom
chore/559-search-crawler-robots

Conversation

@craig-o-curtis

Copy link
Copy Markdown
Contributor

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 .md twins as "Crawled – currently not indexed" and about 134 ?w=/?tz= permalinks as "Alternate page with proper canonical tag". noindex and 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 + Bingbot group. A crawler with its own group ignores * (RFC 9309 §2.2.1), so the group repeats every * rule and the Content-Signal line. It then adds:

    • Disallow: /gmt/*.md$: the .md twins;
    • 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).

  • Applebot is 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 .md twins.

  • Every other crawler, AI agents included, reads the .md twins and llms*.txt as before.

  • CLAUDE.md: the robots.txt rule now says that a change to one group is made to both.

Checks

  • The gmt side's robots-policy.test.ts checks this exact file against a policy table, using robots-parser 3.0.1. All 8 tests pass.
  • After the deploy, curl -s https://northguild.dev/robots.txt should show the new group. Search Console's robots.txt report then picks it up within 24 hours.

…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.
@craig-o-curtis
craig-o-curtis merged commit 5667146 into main Nov 27, 2026
1 check passed
@craig-o-curtis
craig-o-curtis deleted the chore/559-search-crawler-robots branch November 27, 2026 13:48
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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants