# site — how it is put together Written 2026-08-23 with the sample's landing; restructured 2026-08-25 onto the program template's MVC layout (`docs/examples/shop`), so the two samples now read the same way. ## The layout | file | layer | what it owns | | --- | --- | --- | | `types.wo` | MODEL | the `Chapter` `@table`, the `ChapterLink` projection, `Chapters.links()`, and `seed_if_empty()` | | `content.wo` | MODEL (content) | the ten chapter bodies as fragment-returning functions, plus `seed_chapters()` | | `layout/app.wo` | VIEW (chrome) | `AppShell` — the component that fills writeonce-view's `Layout` — the two named widths, and `html_error` | | `layout/header.wo`, `layout/footer.wo` | VIEW (chrome) | the shared nav bar (brand = mark + wordmark) and footer | | `layout/logo.wo` | VIEW (chrome) | the mark as inline SVG, plus the `
` links | | `install/view.wo`, `install/controller.wo` | VIEW + CONTROLLER | `/install` — the toolchain guide. Static copy, so `InstallPage` has no fields | | `packages/view.wo`, `packages/controller.wo` | VIEW + CONTROLLER | `/packages` and `/packages/:name` — the catalogue, its cards, and per-package usage | | `favicon/controller.wo` | CONTROLLER | `/favicon.svg` — builds its own `Resp` (image/svg+xml) | | `home/view.wo` | VIEW | `HomePage` and the homepage's code showcase | | `home/controller.wo` | CONTROLLER | `Home` — the `/` handler | | `chapter/view.wo` | VIEW | `ChapterNav`, `ChapterPage` | | `chapter/controller.wo` | CONTROLLER | `ShowChapter` — the `/ch/:slug` handler | | `admin/controller.wo` | CONTROLLER | `AdminEdit` — bearer-gated edit, answers a redirect (no view: it redirects) | | `health/controller.wo` | CONTROLLER | `Health` — the liveness probe (no view: it answers text) | | `main.wo` | BOOTSTRAP | seed, routes, serve. Nothing else | | `wo.toml` | — | the two `[deps]`: `framework` (serving) and `html` (markup) | One feature = one directory = one module, holding that feature's view and its controller together. A module sees its own declarations plus what it `use`s, so `home/` reaching the chapter nav has to say `use chapter`. The model stays at the root and is reachable from everywhere: a CLASS crosses module lines without being exported, and only a free `fn` is module-scoped (`WO-E210`). That single rule explains the whole layout — `Chapter` and `ChapterLink` are classes, so the feature modules just name them; the shared query would have been a free fn, so it is a `static fn` on `Chapters` instead. (`pub` cannot prefix an `@table` class — recorded gap #1 — but nothing needs it to.) ## Decisions that are not obvious from the code - **Chapters are rows, not constants.** `seed_if_empty()` inserts them only when the table answers empty, so a WAL restart keeps admin edits instead of reseeding over them — the sample's own proof of chapter 6's claim. The seed bodies are BUILT with writeonce-view's builders at boot; after that the table is the truth and the builders are never consulted again. - **The seam is enforced by where the query sits.** `Chapters.links()` lives with the MODEL and hands the view a `multi ChapterLink` — a projection, not a cursor. No component in this sample touches the database, which is what lets `ChapterNav` be the same component on the homepage and on every chapter page, differing only by `current`. - **`HomePage` and `ChapterPage` hold a `Component`, not chapter data.** The nav arrives as an already-built child component in a slot, so neither page knows what a chapter is. That is content projection — Angular's `