--- topic: cms triggers: [cms, "content pages", "$t(", crates/atlas/web/src/cms, registry.json, pages.html, pages-ssr.js, ssr.tsx, frame.tsx, pages/render.rs, script-host/src/render.ts, renderPage, cms-data, "/api/pages", "/mcp", PagesEdit, PagesPublish, hreflang, translation, static_files.rs] updated: 2026-11-16 --- # Content pages: JSX blocks, every text a `$t`, made through MCP ## v3 (2026-11-16): drawn on the server for every visit, taken over in the browser Asked for once Bun was in the server for prim scripts: serve the content pages server-rendered, and keep them able to be interactive. Chosen by the owner over rendering once per publish, so that a component with live data can have it in the first HTML. Everything below v3 still holds, except "no server-side rendering" and step 3 of "How a page reaches a reader". - **The simulator renders every visit to a live page** with the web UI's own views. The web build writes them a second time for the server, `pages-ssr.js` (`src/cms/ssr.tsx`, `renderPage(data) → HTML`), beside `pages.html` and `pages-.js`, so the HTML, the script and the styles always come from one build. A web deploy replaces it; the simulator sees the new modification time and starts its renderer again. - **The renderer is the script host's executable**, started as `cartopolis-script-host render ` (`tools/script-host/src/render.ts`): the server ships one Bun, not two. **Never the script process itself**: that one runs players' code, and a script that got out of its realm must not be able to write cartopolis.org's pages. It gets an empty environment, as the script process does. - **One process, kept running, one page at a time** (`pages/render.rs`): a line of JSON in, a line of HTML out. Its stdout is the answer channel, so Mithril's server log on import and any component's `console.log` are moved to stderr before the bundle loads. - **The browser takes the HTML over** (hydration): the page's data goes with it as `