Search That Belongs on a Static Site
Pagefind adds local search without turning the whole site into an application.
Search is most useful when it feels native to the site and does not require a service account, network dependency, or full app runtime.
Pagefind fits that job. It indexes the built HTML and ships a compact static search bundle. The search UI can live as a small island because that is where client interactivity matters.
Build Time Is the Right Time
The index is generated after Astro builds the pages. That means the search corpus is exactly what readers see, including MDX output and static project pages.
This is also operationally simple. Deploy the dist directory and the Pagefind assets go with it.
A Better Boundary
The rest of the site stays static. The search page owns the client behavior, and every other page remains focused on reading, scanning, and navigation.