Skip to content

feat: site.notFound configures the 404 page for unmatched routes (refs #309) - #316

Merged
jimhoyd merged 1 commit into
mainfrom
site-not-found-309
Sep 20, 2026
Merged

jimhoyd merged 1 commit into
mainfrom
site-not-found-309

Conversation

@jimhoyd

@jimhoyd jimhoyd commented Sep 20, 2026

Copy link
Copy Markdown
Collaborator

Refs #309 (does not close it).

Shape: site.notFound: public/404.html, a generated page route at /404.html (text/html, no-store). The runtime answers an unmatched GET/HEAD with that page and status 404 (project security headers and nosniff still apply); other methods keep the plain-text 404. A route that matched but was disabled/denied keeps its own answer.

Targets: self-hosted, Vercel, AWS serve it via the runtime; --target static writes it as 404.html (point the host error document at it); Cloudflare refuses it at build time like any page route (no asset binding), not silently degraded.

Reporting: one generated route in routes/audit/explain counts (site.notFound), consistent with #298; sitemap excludes it. Schema, docs/SITE.md, STATIC.md, YAML reference, llms-full, starter AGENTS.md updated; new executable example examples/not-found (example count 17 to 18); tests in test/site.test.ts.

Verification: npm ci, npm run verify (0 failures), npm run check:docs.

Open decisions: fixed path /404.html means a direct request returns 200 (matches static hosts); a declared /404.html route shadows the key. Cloudflare support needs an asset-binding decision first.

🤖 Generated with Claude Code

@jimhoyd
jimhoyd enabled auto-merge (squash) September 20, 2026 17:12
@jimhoyd
jimhoyd merged commit f01baec into main Sep 20, 2026
20 checks passed
@jimhoyd
jimhoyd deleted the site-not-found-309 branch September 20, 2026 17:19
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.

1 participant