serve language variants under a prefix

The default locale stays at the root; every other language is the same key under
/{lang}/ (ADR-0009). /en/… is never live and redirects to the root form so the URL
space cannot fork. Lookup now takes a language and reports which one it served,
following requested → default → any rather than 404ing when a translation is
missing.

That is the second routing case, so the resolver is extracted to resolve.go and
the mux keeps one entry: URL shape is the resolver's business. A leading segment
counts as a language only when some bundle is written in it, so an unknown prefix
is a 404 rather than a stripped path — and a section may not be named after a
language in use, now recorded in content-model.md.

Because the served variant can differ from the URL requested, Page gained
.Canonical (the variant actually served) and .Alternates for hreflang. A theme
must never build a path, so both come from the engine.

Evidence: /bn/pages/about/ serves the Bengali body with lang="bn" and canonical
/bn/pages/about/; /bn/posts/hello-world/ falls back to English with canonical
/posts/hello-world/; /en/pages/about/ 301s to /pages/about/; /fr/… is 404.
This commit is contained in:
Claude Opus 5
2026-07-30 01:43:12 +06:00
committed by bdeshi
parent f37e7b1308
commit 275f67dc52
12 changed files with 301 additions and 47 deletions
+3 -2
View File
@@ -62,8 +62,9 @@ visible, it is a Stage wearing a disguise.
`state.md`. Scheduling is an in-process ticker inside the single binary — no cron container and no
queue until ADR-0010's second-service test is actually met.
**Routing** = URL → (Bundle, View), via a resolver. **STATUS: buildable, inline.** Keep cases inline;
extract the resolver when the routing counter in `state.md` is due, not before.
**Routing** = URL → (Bundle, View), via a resolver. **STATUS: live.** The resolver was earned at the
second routing case — the default locale at the root, every other language under a prefix — and now owns
URL shape so the mux has one entry.
---