Pagefind

Pagefind

WHAT IS IT?

Pagefind is a fully static full-text search library written in Rust. It runs after the build of any static site generator, indexes the produced HTML and drops a static search bundle right into your output files. The result: instant search in the browser, with no server, no database and no external service to host or pay for.

WHY IS IT INTERESTING?

  • Zero infrastructure: the index is just a set of static files served alongside the rest of the site. No backend, no SaaS, no API keys to manage.
  • Minimal bandwidth: the index is split into chunks loaded on demand through WebAssembly. Searching a 10,000-page site costs less than 300kB in total, library included. Most sites land closer to 100kB.
  • Works with everything: Pagefind operates on the final HTML, not on your sources. Zola, Hugo, Eleventy, Astro, statically exported Next.js... if the build produces HTML, it works.
  • Multilingual with zero config: multilingual sites are detected automatically, and each language gets its own index with the appropriate stemming.
  • Filters, sorting and metadata: a real filtering engine for faceted search, sorting by relevance or custom metadata, plus fine-grained content weighting.
  • Drop-in UI: since version 1.5, prebuilt web components (search modal included) can be added in a few lines. A low-level JavaScript API remains available to build a fully custom interface.

USE CASES

  • Add full-text search to a blog or documentation site built with Zola, Hugo, Astro or Eleventy
  • Set up faceted search on a knowledge base or a static catalog
  • Replace a hosted search service (Algolia, Meilisearch) when a static index is enough
  • Index non-HTML content (PDF, JSON) through the NodeJS and Python indexing libraries
  • Offer federated search across multiple static domains