Closed simpledemonn closed 3 months ago
okay, that is incredible
shouldn't it better to put the access to the search bar at the bottom-right of the page though? with a small rounded button with the search icon i.e.
It actually highlights matching words, I just fixed that
Not sure about moving it, that's personally where I would expect a search bar to be
The contrast feels kind of low too me, and sites tend to make icon and text of the same color
Best I can do is reenable the border. Although it passes accessibility checks anyway.
This adds a search functionality to the website, powered by lunr.js. While data is prepared and collected during build time, the index is built on the client, as the precomputed index is 1.2 MB, which is already the size of a full page load (even if the data is only fetched once you actually search something). I wasn't able to make this work with dynamically routed pages, although it is fully compatible with all our generated pages, as the content is fetched from the built HTML. I also haven't included pagination and mobile support, probably something for a future improvement.
See preview on Cloudflare Pages: https://preview-200.quiltmc-org.pages.dev