--- /** * Site search for the marketing pages (D47). * * The documentation has had search since phase 1 — Starlight builds a Pagefind index at the * end of every build and puts a box in its own header. The marketing pages were outside it * twice over: not indexed, so a reader searching "Teams" in the docs found the architecture * page and never the feature page; and with no box, so a reader who arrived on the homepage * had a four-item nav and no way to ask a question. * * D47 closed both. `Base.astro` marks its `
` as a Pagefind body, which puts the ten * marketing pages in the same index the docs already query, and this is the box. * * ── Why it is built this way ──────────────────────────────────────────────── * The marketing pages ship almost no JavaScript, and Pagefind's own UI bundle is 120 kB * before the index and the WASM. Loading that on a homepage so that some visitors can * search would be a poor trade, so **nothing is fetched until the dialog is opened** — * the button is inert markup, and the first open injects the stylesheet and the script. * Opening search a second time costs nothing more. * * `` rather than a hand-built overlay: the browser gives us the focus trap, the * inert background, Escape-to-close and the top layer for free, and every one of those is * a thing an accessibility pass would otherwise have to find missing. * * In `astro dev` there is no `/pagefind/` — the index is written by the build. Rather than * fail silently, the dialog says so. */ ---