From d6ec60d61b1136abd2b5992bfcaaf2548f98ee85 Mon Sep 17 00:00:00 2001 From: Cursor Agent Date: Sun, 16 Aug 2026 04:45:22 +0000 Subject: [PATCH] feat(www): emit real HTML pages for catalog and footer routes Homepage catalog and footer links pointed at SPA-only paths. The build now writes index.html for Documents, Packages, Spec, Install, First program, Book, and the rest of the docs tree, each with that page's title and body. Fixes #14 Co-authored-by: Christoffer Hallas --- www/README.md | 7 +- www/SITE.md | 17 +- www/index.html | 1 + www/package.json | 2 +- www/scripts/verify-docs-pages.mjs | 69 ++++++-- www/scripts/verify-prose.mjs | 19 ++- www/scripts/verify-static-dist.mjs | 79 +++++++++ www/scripts/verify-try.mjs | 2 +- www/src/docs/install-content.ts | 220 ++++++++++++++++++++++++ www/src/docs/site.ts | 79 +++++++++ www/src/docs/static-html.ts | 168 ++++++++++++++++++ www/src/install.tsx | 262 ++++++++++------------------- www/src/router.tsx | 52 +----- www/src/try.tsx | 10 +- www/vite.config.ts | 35 +++- 15 files changed, 771 insertions(+), 251 deletions(-) create mode 100644 www/scripts/verify-static-dist.mjs create mode 100644 www/src/docs/install-content.ts create mode 100644 www/src/docs/static-html.ts diff --git a/www/README.md b/www/README.md index 5e9d6a27..51903dff 100644 --- a/www/README.md +++ b/www/README.md @@ -44,8 +44,11 @@ Same layout as the previous `xo.run` site: bindings when the frontend or `std/**/*.echo` changes so Pages can ship the playground without a Rust toolchain. -SPA deep links use the same `public/404.html` → `/?/path` bounce and -`index.html` restore script as before. Custom domain: `public/CNAME` → `xo.run`. +Content routes (Documents, Packages, Spec, Install, First program, Book, and +the rest of the docs tree) are written as `dist//index.html` so those +URLs are real pages. Unknown paths still use the `public/404.html` → `/?/path` +bounce and `index.html` restore script. Custom domain: `public/CNAME` → +`xo.run`. Wasm bindings stay in `public/echo-wasm/`. ## Search diff --git a/www/SITE.md b/www/SITE.md index f1176ddd..6342d1c5 100644 --- a/www/SITE.md +++ b/www/SITE.md @@ -136,6 +136,7 @@ maturity. ## Primary nav The logo is the only Home control. Book stays at `/book` and in the footer. +Catalog, footer, and nav destinations are real HTML files at those paths. | Item | Path | Notes | | ----------------- | ----------- | --------------------------------------------- | @@ -161,6 +162,10 @@ The home page is a language-docs front door. Copy and links live in 3. First-class links: Documents (`/docs`), Packages (`/docs/std`), Spec (`/e26`) 4. Footer +Each of those links, plus Install, First program, Book, and Try, is a real +page (`path/index.html`) with that page title and body. A destination +without a document is removed from the catalog or footer. + Homepage trust stays factual. Rust, LLVM, the public edition, and the machine-checked suite are implementation facts. @@ -169,7 +174,7 @@ machine-checked suite are implementation facts. `/docs` is a short catalog. Groups: Start (install, first program, project), Language (the Echo 2026 form pages), Packages (std + API index), Spec (Echo 2026 + Language Spec). Each entry has a title, one-line description, -and a working path. +and a working path that the build writes as HTML. ## Echo 2026 section @@ -183,6 +188,16 @@ and a working path. Cross-links: Reference ↔ Spec ↔ suite pages keep the triangle explicit. +## Static pages + +`npm run build` writes `index.html` for every content route: the homepage, +`/install`, `/try`, and each page in `docsPages` (Documents, Packages, Spec, +Book, First program, and the rest of the Reference / std / suite pages). +Each file keeps the SPA shell and a noscript body from the same modules the +React app renders. Unknown paths still use the `404.html` bounce. + +Wasm bindings stay in `www/public/echo-wasm/`. + ## Playground `/try` runs the shared compiler frontend in WebAssembly (`just wasm`). It diff --git a/www/index.html b/www/index.html index 95d8716e..be058abb 100644 --- a/www/index.html +++ b/www/index.html @@ -4,6 +4,7 @@ Echo Programming Language +