|
| 1 | +# Echo Docs — rebuild on Astro Starlight ("Terminal" theme) |
| 2 | + |
| 3 | +**Date:** 2026-06-14 (rev. 2 — post-review) |
| 4 | +**Status:** Design — hardened after architecture + docs-platform review |
| 5 | +**Repo:** `labstack/echox` (docs site in `website/`), branch `docs-astro-rebuild` |
| 6 | + |
| 7 | +## 1. Goal |
| 8 | + |
| 9 | +Replace the current Docusaurus docs with a professional, `docs.openclaw.ai`-grade site |
| 10 | +branded for Echo. The previous attempts read as "default/amateur" because of generic |
| 11 | +system-sans on a cool palette; the new design commits to a **terminal-precise** aesthetic. |
| 12 | + |
| 13 | +## 2. Locked decisions (rev. 2) |
| 14 | + |
| 15 | +| Decision | Choice | Notes | |
| 16 | +|---|---|---| |
| 17 | +| Platform | **Astro Starlight** (base) + custom Terminal theme | *Changed from full-custom Astro after review.* Starlight gives sidebar, i18n+fallback, Pagefind search, prev/next, TOC, edit links, last-updated, per-page SEO/OG, sitemap, 404, theme toggle, mobile drawer, a11y baseline — we override the theme for the look. Far less to build/own. | |
| 18 | +| Design direction | **Terminal** | Locked via mockups (`refine-terminal.html`, `home.html`). | |
| 19 | +| Fonts | **DM Sans** for prose & headings · **Fragment Mono** for code + UI chrome (nav, sidebar, labels, ⌘K) | *Changed from mono-everywhere* for long-form readability; terminal feel kept in chrome/code. | |
| 20 | +| Palette | warm near-black `#0d0b0b`, warm grays, **Echo cyan** | Cyan from logo; **contrast-tuned** (see §6). | |
| 21 | +| Theme | dark-first + light | Starlight toggle; dark default. | |
| 22 | +| Content | rewritten fresh, **seeded by porting existing pages** | Avoid blank-page risk on 61 existing pages (review). | |
| 23 | +| Launch versioning | **v5 only**; v4 added later via `starlight-versions` | Defers Starlight's one weak area. | |
| 24 | +| Search + Ask Echo | **unified ⌘K** with Search (Pagefind) + Ask tabs | Override Starlight `Search` component. | |
| 25 | +| Deploy | **Cloudflare Pages** (+ `_redirects`) | Fast, Pagefind-friendly, native 301s. | |
| 26 | + |
| 27 | +## 3. What Starlight gives us vs. what we build |
| 28 | + |
| 29 | +- **Starlight (free):** content collections, sidebar config, prev/next, TOC, Pagefind ⌘K, |
| 30 | + i18n routing + en-fallback, per-page `<title>`/description/canonical/OG/Twitter, sitemap, |
| 31 | + `404`, edit-on-GitHub (`editLink`), `lastUpdated` from git, dark/light toggle + persistence, |
| 32 | + mobile drawer, keyboard-accessible nav. |
| 33 | +- **We build/own:** |
| 34 | + 1. **Terminal theme** — `src/styles/terminal.css` (Starlight CSS custom props + targeted |
| 35 | + overrides), Shiki theme JSON, font wiring (DM Sans prose / Fragment Mono chrome+code). |
| 36 | + 2. **Unified ⌘K** — override `components.Search` with `CommandPalette.tsx` (Pagefind tab + Ask tab). |
| 37 | + 3. **Ask Echo** — provider-pluggable island; stub stream now, `askProvider(query, locale)` hook |
| 38 | + for kapa.ai / Inkeep + key later. |
| 39 | + 4. **DocActions** — Copy page / Open in ChatGPT / Open in Claude (Edit + Last-updated already from Starlight). |
| 40 | + 5. **Homepage** — custom `index.astro` (Starlight `splash` template or standalone): split hero |
| 41 | + + code window + stats + feature grid. |
| 42 | + 6. **Redirect map, analytics, contrast/a11y tuning, cutover** (§6, §7). |
| 43 | + |
| 44 | +## 4. Architecture |
| 45 | + |
| 46 | +``` |
| 47 | +website/ |
| 48 | + astro.config.mjs # starlight() integration: title, logo, social, editLink, |
| 49 | + # lastUpdated, sidebar, locales, components overrides, sitemap |
| 50 | + src/ |
| 51 | + content/docs/ # MDX content (Starlight collection) |
| 52 | + index.mdx # homepage (splash) OR pages/index.astro |
| 53 | + <locale>/core/routing.mdx ... # en authored first |
| 54 | + components/ # Starlight component overrides |
| 55 | + Search.astro # mounts CommandPalette island (unified ⌘K) |
| 56 | + CommandPalette.tsx # island: Search (Pagefind JS API) + Ask Echo tabs |
| 57 | + DocActions.astro # copy / ChatGPT / Claude toolbar (in PageFrame or content) |
| 58 | + styles/ |
| 59 | + terminal.css # the design system (tokens + overrides) |
| 60 | + shiki/echo-terminal.json # custom Shiki theme (warm bg, cyan keywords) |
| 61 | + public/ |
| 62 | + logo-*.svg og-*.png robots.txt _redirects # Cloudflare 301 map |
| 63 | +``` |
| 64 | + |
| 65 | +**Isolation:** the theme is pure CSS over Starlight's documented custom properties → no fork |
| 66 | +of Starlight internals; only two component overrides (`Search`, optionally `Head`/`PageFrame` |
| 67 | +for DocActions). `CommandPalette.tsx` and `AskEcho` logic are self-contained islands. Content |
| 68 | +is the single source of truth; everything else is configuration + theme. |
| 69 | + |
| 70 | +## 5. Design system (`terminal.css`) |
| 71 | + |
| 72 | +- **Fonts:** `--sl-font: "DM Sans", ui-sans-serif, system-ui, sans-serif` (prose+headings); |
| 73 | + `--sl-font-mono: "Fragment Mono", ui-monospace, SFMono-Regular, Menlo, monospace` (code). |
| 74 | + Apply Fragment Mono to UI chrome (`.sidebar`, site nav, `.sl-markdown-content` inline UI, |
| 75 | + labels, ⌘K) via targeted selectors. **Self-host both fonts** (woff2, subset), `font-display:swap`, |
| 76 | + `preload` the prose font (FOUT fix). |
| 77 | +- **Color (dark):** bg `#0d0b0b`, surface `#151210`, line `#221e1c`/`#2d2724`, text `#aaa19d`, |
| 78 | + heading `#f4f1ef`, muted `#817a76`. Map to Starlight `--sl-color-*`. |
| 79 | +- **Accent (contrast-tuned):** use brighter cyan **`#33c9e6`** for small text/links on dark |
| 80 | + (≥ ~7:1) and reserve `#00afd1`→`#4ae1ff` for fills/large/decorative — fixes the ~5.9:1 issue. |
| 81 | +- Light theme: warm paper `#faf8f7`, ink `#1a1614`, darker cyan for AA. |
| 82 | +- Radius 9–13px; hairline borders; one soft cyan glow; faint grain (disabled under |
| 83 | + `prefers-reduced-motion`). |
| 84 | + |
| 85 | +## 6. Production / launch requirements (added per review) |
| 86 | + |
| 87 | +- **SEO:** rely on Starlight per-page title/description/canonical/OG; ensure every MDX has |
| 88 | + `title` + `description` frontmatter. Add **JSON-LD** (`TechArticle` + `BreadcrumbList`) and |
| 89 | + `public/robots.txt` → sitemap. Set **v5 as `rel=canonical`** version. |
| 90 | +- **Redirects (deliverable):** crawl the live site, produce an explicit **old→new 301 table** |
| 91 | + in `public/_redirects`. Cover the 3 alias families (`/guide`, `/cookbook`, `/middleware`), |
| 92 | + the one-off redirects, and any old slug with no 1:1 new home (resolve each). No silent drops. |
| 93 | +- **Analytics:** carry over **GA4 `G-H19TMZLQFN`** (anonymizeIP) via Starlight `head` inject; |
| 94 | + confirm whether to keep or replace. |
| 95 | +- **Broken-link gate:** CI step (`lychee`/`astro-broken-link-checker`) that **fails the build**, |
| 96 | + matching the old `onBrokenLinks: throw`. |
| 97 | +- **Accessibility:** WCAG-AA contrast audit of every token pair; `:focus-visible` rings; |
| 98 | + `prefers-reduced-motion` disables glow/grain; the ⌘K palette uses an accessible |
| 99 | + combobox pattern (focus trap, `aria-activedescendant`, SR announcements). |
| 100 | +- **Responsive:** Starlight handles sidebar/TOC drawers; we ensure the **homepage hero stacks** |
| 101 | + (terminal window below headline) on mobile. |
| 102 | +- **i18n realism:** keep non-en locales **behind a flag** until real translations exist; add |
| 103 | + `hreflang` + `x-default` when they ship; Ask Echo answers carry a `locale` param with an |
| 104 | + "answers in English" note where the provider lacks localization. |
| 105 | +- **CodeBlock features:** copy button, language label, filename, line-highlighting, and |
| 106 | + tabbed examples (Starlight Expressive-Code or our wrapper). |
| 107 | + |
| 108 | +## 7. Implementation phasing |
| 109 | + |
| 110 | +- **Phase 1 — Platform + theme + slice (first plan).** Starlight scaffold in `website/` |
| 111 | + (replacing Docusaurus), `terminal.css` design system + Shiki theme + self-hosted fonts, |
| 112 | + `Search`→`CommandPalette` override with Ask Echo island (stubbed), `DocActions`, custom |
| 113 | + **homepage**, contrast/a11y tokens, and a real **content slice** (Quickstart, Routing w/ code, |
| 114 | + one nested page). Final `/...` URL/Pagefind/i18n config in place. Dark+light. Shippable to a |
| 115 | + **preview** subdomain. |
| 116 | +- **Phase 2 — Content.** Author full v5/en docs (Guide, Core, Cookbook, Middleware, API), |
| 117 | + seeded by porting+editing existing pages. Site is launch-ready at completion. |
| 118 | +- **Phase 3 — Versioning + locales + cutover.** `starlight-versions` for v4, enable locales + |
| 119 | + translations, finalize `_redirects`, GA, JSON-LD, broken-link CI, **cutover runbook** |
| 120 | + (preview → verify redirects/SEO/search → domain swap on `echo.labstack.com` → keep old |
| 121 | + Docusaurus deployable ~2 weeks for rollback). |
| 122 | + |
| 123 | +## 8. Out of scope (now) |
| 124 | + |
| 125 | +Live AI provider keys (UI + hook only); real translations (scaffold only); marketing pages |
| 126 | +beyond the homepage; v4 content (Phase 3). |
| 127 | + |
| 128 | +## 9. Risks |
| 129 | + |
| 130 | +- **Content rewrite is the largest cost** (61 pages × locales) — Phase 2 may need its own |
| 131 | + decomposition; mitigate by porting existing prose rather than blank-page rewriting. |
| 132 | +- **Starlight theming ceiling:** the Terminal look must be achievable via custom props + |
| 133 | + light component overrides; if a surface resists theming, prefer a small component override |
| 134 | + over forking Starlight. (Low risk — the look was already achieved via CSS on Docusaurus.) |
| 135 | +- **`starlight-versions` maturity** for v4 in Phase 3 — re-evaluate at that point; v5-only |
| 136 | + launch de-risks it. |
0 commit comments