Skip to content

Pagefind v1.0.0 β€” Stable static search at scale ✨ πŸš€

Choose a tag to compare
@bglw bglw released this 13 Sep 18:05
· 118 commits to main since this release

Pagefind 1.0 is here! This release has been many months in the making, and we're thrilled to be bringing some great new features and improvements.

This release also marks a point in time for Pagefind's stability and maturity. Thanks to everyone who has helped out with contributions and feedback in the last year, we're now more confident than ever that Pagefind is a perfect fit with nearly any static website, staying performant and lean even as your site scales.

‼️ Breaking Changes

This 1.0 release includes one breaking change, and some notable non-breaking behavioral changes.
A full writeup of these changes and their effects exists in the πŸ“˜ Migrating to Pagefind 1.0 guide on Pagefind's website.

    • PREVIOUS: By default, Pagefind 0.x outputs files to a _pagefind in your site.
    • NEW: By default, Pagefind 1.x outputs files to a pagefind in your site.
    • More details on this change can be found in the [πŸ“˜ migration guide].

⚠️ Behavioral Changes

  • Changes to CLI options [πŸ“˜ migration guide]:
    • The source option has been renamed to site.
    • The bundle-dir option has been renamed to output-subdir.
    • A new output-path option has been added.
  • Search indexing and ranking changes will cause result lists to differ from 0.x [πŸ“˜ migration guide].
  • The JS API initializes Pagefind at a different stage of execution [πŸ“˜ migration guide].

πŸŽ‰ New Features!

✨ Content weighting ✨

Pagefind now supports configurable weighting for regions of content, which will be used when ranking results and generating excerpts.
Headings are automatically weighted higher, and custom weights can be inserted anywhere in your page.

See πŸ“˜ Weighting sections of the page higher or lower for documentation.

✨ Sub results ✨

Pagefind now tracks headings and IDs when indexing your site. This can be used to show multiple results per page when searching your site, with direct links to the closest parent anchor.

See πŸ“˜ Showing multiple results per page for documentation.

✨ NodeJS indexing API ✨

The pagefind package on npm can now be imported as a library into a NodeJS script, giving you programmatic control over indexing content from both disk and memory.

This feature is very open ended β€” be it integrating Pagefind into a static site generator, or indexing non-static and non-HTML content, we're excited to see what people come up with! Open a discussion on GitHub if you build anything unique that you would like to share!

See πŸ“˜ Indexing content using the NodeJS API for documentation.

✨ Greatly improved ranking and relevancy ✨

Pagefind now takes inverse document frequency into account, meaning words that are unique across your site will rank higher than common words.
The ranking algorithm has also been improved across the board, which should result in better search relevance by default.

We're always looking to improve search relevance further, so open an issue on GitHub if you have any examples of searches that don't hit the mark.

✨ Indexing compound words and code ✨

Pagefind now better supports indexing various forms of compound words and code, meaning <MyComponent data-pagefind-body> will now match searches for my, component, data, pagefind, and body.

πŸŽ‰ More Features & Improvements

  • Pagefind now returns results for a prefix of the search word if there would otherwise be zero results:
    • e.g. if searching for bandwidth would return zero results, you might get results for band or ban.
  • Pagefind can now search for emoji πŸŽ‰πŸš€βœ¨.
  • Do you filter more than you search? For those using the JS API directly, Pagefind now supports complex compound filtering:
  • Pagefind is now smarter at generating excerpts, returning the most dense region of search hits on the page.
    • Excerpt calculation also integrates with the new weighting feature, and will favor areas of the page with higher weighted words.
  • The pagefind npm package no longer downloads binaries from a GitHub release, and instead has platform-specific dependencies that download only the relevant binary from npm.
    • This improves the installation speed of Pagefind through npm/npx, and also removes the need for any postinstall script making the entire process more reliable.
  • The Default UI now supports being passed an HTMLElement directly, as an alternative to a selector (PR #331 β€” thanks @stefanprobst).
  • The length of excerpts that Pagefind generates can now be customized:

Fixes & Tweaks

  • CLI: Fixed an issue where multiple data-pagefind-body tags on a page would conflict if one was nested deeper than the other.
  • CLI: Fixed builds for some Windows systems that were missing vcruntime.
  • JS API: A new pagefind.init() function has been added, meaning pagefind.options() can be called before loading assets, allowing you to change the path to load files from.
  • JS API: Performance searching very large sites for short terms should be improved.
  • JS API: Passing an empty array for a filter value now behaves as if the filter was not supplied, instead of returning zero results.
  • Default UI: Don't reset the browser-provided outlines when resetting UI styles.
  • Default UI: Fixed an issue where titles containing HTML elements were not correctly escaped.
  • Default UI: Improved the search input on mobile devices (PR #368 β€” thanks @valtlai !).
  • Default UI: Fixed an issue where some UI strings would appear in English instead of the translated language.

UI Translations