Skip to content

Search with Pagefind - #68

Merged
StfBauer merged 3 commits into
mainfrom
feat/search
Nov 16, 2026
Merged

StfBauer merged 3 commits into
mainfrom
feat/search

Conversation

@StfBauer

Copy link
Copy Markdown
Contributor

0.5.0 step 5: site search, built by pd build with the project's own Pagefind.

  • The index: each page's own content (its rendered markdown and placed components) with its title, never the layout's header, navigation, listings or related pages. Built in memory from the crawl, checked, then written to _pd/search/ under the site's path. Filters: section (the page's collection), tag, category, by label.
  • Left out: the 404 page, tag and category pages and their indexes, redirect stubs, pages with index: false. Drafts and scheduled pages are never built.
  • storefront.search: left out, on when the project has Pagefind (npm install --save-dev pagefind); true stops a build without it; false turns it off.
  • pd build --browser: serves the index from memory and uses the first search field per viewport: no result within 5 s stops the build; axe runs again on the results.
  • pd dev: no index (saves stay as fast), and a start-up line says so.
  • Starter: components/search (a <search> landmark, labelled field, announced status, results with title, section and passage; section filter; works as a plain form without script) on a search page.

Pagefind 1.6.0, MIT, one platform binary of 12 to 14 MB per machine; root devDependency only.

Tests: unit (record, exclusions, document, index, config, start-up note), bench E2E (a word finds its page, the filter narrows, a listing teaser word finds the page not the listing, a draft word finds nothing, under a path, without Pagefind), --browser with a dead search field, the static bench serves its index. Golden G0 unchanged.

pd build indexes each page's own content (its rendered body, never the
layout's markup) with the project's own Pagefind and writes the index to
_pd/search/ under the site's path, with section, tag and category filters.
storefront.search: left out, on when the project has Pagefind; true stops
a build without it; false turns it off. The 404 page, tag and category
pages and pages with index: false are left out. pd build --browser serves
the index from memory and uses the site's search field once per viewport.
pd dev builds no index and says so at start.
@StfBauer
StfBauer merged commit 97f7903 into main Nov 16, 2026
9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant