Search is Pagefind, an index built at pnpm build from the rendered
listing pages. features.search turns it on; it is true by default.
-
Build.
Terminal pnpm buildIt prints one line, where
Nis the number of listing pages:[zerodirs:pagefind] indexed N pages → pagefind/ -
Serve the build.
Terminal pnpm previewOpen
http://localhost:4321/search/. The status line readsType at least 2 characters, or pick a filter, to search tools. -
Search with the query in the URL.
Open
http://localhost:4321/search/?q=writing. The status line shows<n> tools, orShowing 10 of <n> toolspast ten. -
Filter without a query.
Open
http://localhost:4321/search/?pricing=free— results appear with nothing typed. Change the sort to Most popular: the address bar gains&sort=popularityand the back button gains nothing.
Verify
Section titled “Verify”| Where | You should see | |
|---|---|---|
| The bundle | ls dist/client/pagefind/ |
pagefind.js, pagefind-entry.json, index/, fragment/, filter/ |
| One island, on one page | the build log | zero-js: <n> content pages, 0 islands, 0 external scripts — ok |
| A result | /search/?q=<a listing name> |
that listing first: logo or letter tile, name, badges, tagline |
| A shared link | the filtered address bar, reopened in a new tab | query, filters and sort come back |
| Only listings | /search/?q=<a category name> |
listings from that category; never the category page itself |

Worth knowing
Section titled “Worth knowing”- ⌘K / Ctrl K opens the command palette on every page: a search field, the site’s quick
links and its featured listings, filtered as you type; Enter runs the full search on
/search/. The⌘Kbadge in the home-page field opens it too. The palette is a native<dialog>with server-rendered rows and one inline script, so it needs no Pagefind and works underastro dev. The header has no search field of its own. - A detail page that loses its hidden
data-pagefind-sortspan drops out of sorted results. /search/is the only page allowed an<astro-island>or a<script src>;integrations/budget.tsfails the build if any other page carries one./search/isnoindexand disallowed inrobots.txt.- The URL carries
q(up to 200 characters; under 2 the filters search alone),category,tagandpricing(slugs fromsite.config.ts) andsort(relevancedefault,popularity,date); category and tag pages link in with?category=<slug>and?tag=<slug>.
When it is off or degraded
Section titled “When it is off or degraded”| Config state | The visitor sees | Fix |
|---|---|---|
features.search: false |
no search box anywhere (Browse all tools and Categories replace it on the home page), no Search within on category and tag pages, /search/ 404s |
set it back to true |
pnpm dev |
Search is not available yet. Run `pnpm build`, then `pnpm preview`, to try search locally. |
expected |
| The index failed to write | a build warning, indexing failed (…); build continues without pagefind/ |
usually the Pagefind binary for your platform |
No page carries data-pagefind-body |
no page with data-pagefind-body found in …; writing an empty index so /search/ still loads; every search finds nothing |
pagefindBody() is missing from the detail template |
| The file budget | budget: warns above 80% of the plan limit, fails the build above 90% |
see Cost and limits |
Configuration
Section titled “Configuration”features.search — features. There is no search block: the minimum query length, the result cap and the tagline weight are SEARCH_MIN_QUERY, SEARCH_MAX_RESULTS and SEARCH_META_WEIGHTS in src/lib/search.ts, and the debounce is DEBOUNCE_MS in src/islands/SearchPanel.tsx.
- integrations/pagefind.ts builds the index at
astro:build:done Directorysrc/
- islands/SearchPanel.tsx the island: filters, sort, URL state, debounce
- pages/search.astro the only page with an island
- lib/search.ts the attribute helpers, the URL parser and the constants
- components/listing/Detail.astro the indexed body: meta, filters, sort carrier