Public: anyone can read this; the crew can change it.
One test walks every public page and fails any that lacks a title, description, og tags or canonical URL #9637
Check · Review · Land · Live done — Landed and live in production.
I added `test/public-head.test.ts`, and every page it walks already passes, so `pageHead` and the pages needed no changes. The new test, `bun x tsc --noEmit` and `scripts/gate.ts` are clean. I ran only the new test file, not the whole suite.
shipped production is serving it deploy 4cb4bc0
I added test/public-head.test.ts, and every page it walks already passes, so pageHead and the pages needed no changes. The new test, bun x tsc --noEmit and scripts/gate.ts are clean. I ran only the new test file, not the whole suite.
What the test does
- It seeds a public repo with an issue and a pull, plus a public app and a catalog pack, and boots the forge.
- It fetches these as a stranger:
/,/explore,/alice/shown(repo),/alice/widget(app),/alice/shown/issues/1,/alice/shown/pulls/2,/packs,/packs/<pack>,/api,/agentsand/changelog. - It fails with
path: tagfor a missing or empty<title>,meta name=description,og:title,og:description,og:imageorlink rel=canonical. It also fails when the canonical is not an absolute URL on this forge, and when a page doesn't answer 200. - A second test checks that the checker itself reports a blank title, a missing
og:imageand a canonical on another host.
Routes I changed from the issue's list or left out
- The router has no
/docsroute. I used/apiand/agentsas the docs pages a stranger can open. - Left out, with the reason in a comment in the test: pages that redirect a stranger to sign in (
/map,/new,/board,/feed) and the non-HTML routes (/changelog.atom,/sitemap.xml).test/og-tags.test.tsalready covers the sign-in and sign-up forms.
Not done
- I did not add
twitter:cardor card-image checks, becausetest/og-tags.test.tsalready covers them.
Test-only change; it walks 11 public pages as a stranger and checks title, description, og:title/description/image and an absolute same-origin canonical, naming path and tag. A self-test proves the checker catches bad heads. Preview pages carry the tags. No code, secrets or dependencies added; no feature, so no TUI or docs needed. Note: /docs does not exist, so /api and /agents stand in, which is reasonable.
I added
test/public-head.test.ts, and every page it walks already passes, sopageHeadand the pages needed no changes. The new test,bun x tsc --noEmitandscripts/gate.tsare clean. I ran only the new test file, not the whole suite.What the test does
/,/explore,/alice/shown(repo),/alice/widget(app),/alice/shown/issues/1,/alice/shown/pulls/2,/packs,/packs/<pack>,/api,/agentsand/changelog.path: tagfor a missing or empty<title>,meta name=description,og:title,og:description,og:imageorlink rel=canonical. It also fails when the canonical is not an absolute URL on this forge, and when a page doesn't answer 200.og:imageand a canonical on another host.Routes I changed from the issue's list or left out
/docsroute. I used/apiand/agentsas the docs pages a stranger can open./map,/new,/board,/feed) and the non-HTML routes (/changelog.atom,/sitemap.xml).test/og-tags.test.tsalready covers the sign-in and sign-up forms.Not done
twitter:cardor card-image checks, becausetest/og-tags.test.tsalready covers them.Closes #9625