Search
Every writedocs build indexes the site automatically, using Pagefind — a static search engine that runs entirely client-side, with no external service, API key, or ongoing cost.
There’s no writedocs.json field for this — search is on by default for every site. If you can build your site, you have search.
What gets indexed
Every page’s rendered content is indexed, with the page title weighted as the primary match signal. Sidebar and topbar chrome (navigation links, the theme toggle, the “Copy page” menu, etc.) is excluded from the index, so results only ever surface actual content.
Each page is also found by the names of the sections it sits in - the tabs, dropdowns, versions and groups above it - so searching for a tab’s name finds its pages. Every result shows that path under its title, like v2 › API Reference › Webhooks.
Versions, languages and products
On a site with versions, languages or products, search shows results from the ones the reader is on - a reader of v2 in English sees v2 English pages, plus pages outside every version, language and product. A line under the results says which, with a Search everything link that searches the whole site.
Keyboard
⌘K (Ctrl K outside macOS) opens search from anywhere. Up and Down move through the results, Enter opens the selected one, and Escape closes search.
How it works
The index is built as a post-processing step after Astro finishes rendering — Pagefind scans the compiled dist/ HTML directly, rather than plugging into the build pipeline itself. This is why a successful build’s last lines look like:
✓ Built 42 pages in 6.1s
✓ Indexed search
✓ Done in 7.0s - site written to distThe index (dist/pagefind/) is a handful of static files alongside your site — it deploys with everything else, no separate infrastructure to run.