Tech Note: Search
Hi — my name is Mark, and I’m a tech director and writer who volunteers on the Unbreaking website team. Our 2026 has brought a welcome increase in product development, as we’ve gradually added some features to support our growing editorial work. One of those features is search. Our site didn’t have it when we launched, for a number of reasons: it doesn’t come by default with our static publishing tool, Eleventy, and we had a much smaller volume of content on the site. As our work at Unbreaking continued to grow, however, search started to feel like a feature that would benefit not just our readers, but our entire editorial team.
Research
Search typically works by looking for keywords in an index of content. For sites running on a database-driven architecture (e.g. WordPress) this means running a search against the database, looking at fields like titles, excerpts, and body content. Since our site is built using the static publishing tool Eleventy, there is no database, only static HTML and assets. Search would require building a searchable index of some sort.
So we started to research current options. In the past I have used Elasticlunr.js, but I wanted to see if newer alternatives existed, preferably with a bit less configuration overhead. In the last five years the Eleventy community has gravitated to one of two options: a platform-hosted solution like Algolia, or the static library Pagefind.
Even though I use Algolia on many projects at my day job, I ruled it out pretty quickly because of its architecture: Algolia stores your search index on their platform. It felt like an unnecessary security and privacy exposure to have our work on another platform, regardless of the privacy policy.
Pagefind is a bit closer to Eleventy in philosophy — you run it to build an index that sits alongside your content. Since its initial release in 2022, it’s built up community support, and there are plenty of blog posts from people using it in different ways, which gave us a fair amount of confidence that we could implement it and modify it to suit our needs.
Keyword: existentialism
Keyword search seems fairly simple, conceptually: look for a word. But what is a word, in this context? If I’m searching for “immigration” I might also want results for “immigrant” or “immigrants.” Search tools use a variety of techniques to find these adjacent terms, and Pagefind’s approach is to use Snowball, which is a library for language “stemming.” Snowball defines stemming like this:
Stemming maps different forms of the same word to a common “stem” - for example, the English stemmer maps connection, connections, connective, connected, and connecting to the stem connect. So a search for connected would also find documents which have the other forms.
With a stemming library in place, you get a little more fuzziness in search. Searching for immigrant on our site will return results for immigrant, immigrants, immigration, since they share the same “immigr” stem.

Prototyping
Implementing search was a collaborative effort, and like our sidenotes, it started with a prototype. I spun up a branch in our git repo, adding in the Pagefind (v1.4) default component and styling, and created a branch environment for our editorial and website teams to play with and evaluate. The feedback from these initial tests was valuable. While everyone was in agreement that search would be useful, there were questions about what should show up in results. For example, we had been experimenting with internal tags for editorial work — should those trigger results?
It also revealed some surprises: We found out that Eleventy was automatically generating pages for authors and team members, which we didn’t want. We removed those pages, and used Pagefind’s data-pagefind-ignore attribute on elements which we didn’t want to get indexed, like the date a page was last updated.
Styling
Once our team was happy with how search was behaving, we shifted focus to layout and styles: would search have a dedicated page, or would it be available at all times? Where and how would the interface show up? Ethan Marcotte led our styling efforts, finding the edges of Pagefind’s constraints. Pagefind exposes a number of CSS custom properties (variables), but we found it easier to write our own CSS declarations for the default Pagefind classes.
Version 1.4 of Pagefind is also a unified component, so we made the decision to place the search field and results between our main header navigation and the main content of the site. A “Load More” button allows users to expose more results beyond the initial set.
What we’ve learned and what’s next
Pagefind is useful, but it carries constraints: It doesn’t expose any interfaces to tweaking the Snowball stemming library, so there were a few instances of overly wide search results. For example, in early testing a search for toxic also returned a large number of results for to. It turned out to be a Snowball bug, which appears to be rectified with the latest versions.
Pagefind v1.5 brought a new component-based architecture, which splits the unified interface into three areas: search input, summary, and results. We’ve tried this out in a prototype but have not shifted to using it yet, because at present it displays all the results at once, instead of providing pagination/load more functionality. We’re keeping an eye on it as it evolves.
For now, search is stable, and usable, and there’s no shortage of other work to do. If this type of product-level tinkering with design and code sounds like your theme music, perhaps consider joining us?