What this thread does
Do first: keep Astro output: 'static' and Starlight pagefind: true, then set the deployment base before generating documentation and blog URLs.
Short answer
As of November 2026, use current Astro docs and Starlight 0.43.1 (release list). Starlight supplies documentation navigation and search; add blog routes separately. Build HTML before indexing, and publish HTML and search assets from the same build.
Choose / don't choose
- Pagefind: choose for public, build-time content; don't use search exclusion as privacy protection.
- Hosted or authenticated search: choose when per-user access or updates between site builds are required. This is an architectural choice: enforce permissions in retrieval and weigh external requests and operational cost against browser index downloads.
- Static pages: choose for documentation and a blog without request-time personalization; don't hydrate entire articles merely to enable a search control (search guide, directives).
Not for: choosing an editable blog CMS; see astro-cheap-cms-keystatic-or-sanity.
Settings that matter
| Setting or flag | Value / default | Applies to | Source |
|---|---|---|---|
site | Final deployed origin, e.g. https://example.com | Current Astro docs | configuration |
base | Actual mount path, e.g. /docs; prefix links with import.meta.env.BASE_URL | Current Astro docs | configuration |
trailingSlash | Default ignore; choose always for slash URLs when the host serves directory indexes | Current Astro docs; host must agree | configuration |
output | static (default); pages prerender unless opted out | Current Astro docs | configuration |
client:load, client:idle, client:visible | Immediate for essential interaction; idle for deferred interaction; visible for offscreen islands; omit for static markup | Current Astro docs | directives |
pagefind, prerender | Both true by default; Pagefind cannot be enabled with prerender: false | Current Starlight docs | configuration |
sidebar | Curated items or autogenerate: { directory: 'guides' } for a docs folder | Current Starlight docs | configuration |
Order of operations
1. Add docs to the Starlight collection and configure sidebar entries. Add blog pages through Astro file routes; dynamic static routes must enumerate their entries with getStaticPaths(). (routing). 2. Build HTML. For a custom Astro integration, run npx pagefind --site dist after Astro has emitted HTML; do not index source Markdown or double-run indexing without a reason (Pagefind CLI). 3. Deploy the entire output including pagefind assets. Preview the production build, search a distinctive phrase from a doc and blog post, follow results, then open those deep links directly. 4. For missing pages, inspect emitted blog routes, result URLs and asset requests. Compare mount prefix and slash policy against the host; avoid both dropping and doubling base. Rebuild the index after URL/content changes, then publish the matching HTML and index together.
Known failures and fixes
| Error (short quote) | Cause | Fix | Source |
|---|---|---|---|
Failed to load the Pagefind WASM: | Host CSP blocks WebAssembly compilation | Permit the documented script-src 'wasm-unsafe-eval' where appropriate, retaining other restrictions | torn4dom4n / HiDeoo, December 17, 2025, hosting |
Diagnostic: Failed to load the Pagefind WASM:
Check the browser console and response CSP before changing content-language configuration. The dated report concerns CSP, not absent Vietnamese indexing.
Missing
- No site size, private-content policy or update cadence establishes a universal hosted-search threshold. Measure search downloads on representative queries before choosing a payload budget.
- The linked source does not confirm: a separate blog may need explicit Pagefind indexing selectors.
Checked
2026-11-12; current Astro documentation; Starlight 0.43.1 (version rechecked 2026-11-15; releases). Linked configuration, routing, directives, search/CLI/hosting pages and discussion read. No site build executed.
Started from a post by @Astro, packaged by the editor. Original post