Static sites don't make search functionality easy, but luckily there are some excellent services that do. I've been messing around with Algolia and finally have it working with Craft and Gatsby the way I want it... on the backend, at least.
📖
Adding Search: User Interface (Algolia, Gatsby, Craft CMS - Part 2)
Having hooked up Algolia with my Gatsby build pipeline and populated a search index from my Craft CMS API, the next step was the build a frontend UI to enable users to actually query my posts. It turned out to be a pretty simple process.
📖
Adding Search: Refining The Frontend (Algolia, Gatsby, Craft CMS - Part 3)
The search page is live, the index is populated, but it all looked a bit rubbish and it didn't quite work as well as I wanted. Now it's using custom-styled components, queries are tracked/stored via the URL for persistence, and you can filter results based on category.
In which I start off asking a simple question: what content categories should I use on this website? Four hours later, I've discoverd information gardening, now pages, digital-me libraries, and oh so much more. And yes, I think I've answered that first question. Fancy a trip down the rabbit hole?
The new dominant layout methods in CSS – grid and flexbox – have solved a lot of issues. Still, sometimes the ideal layout is somewhere in the middle: a flexible grid-like mashup. With a bit of outside-the-box thinking, you can there from either angle.