4 ms·
I've been looking for a simple incremental client-side search for my personal wiki (https://beepb00p.xyz/exobrain https://beepb00p.xyz/exobrain), but didn't fin
by karlicoss 6y ago
I've been looking for a simple incremental client-side search for my personal wiki (https://beepb00p.xyz/exobrain https://beepb00p.xyz/exobrain), but didn't find anything immediately suitable sadly. Basically I wanted the indexing & search to be as simple as possible:
- take in the raw HTML files (so it's agnostic to the site generator)
- indexing should be respectful of `id=` anchors, so you can jump directly to the occurence in the document text (instead of just the HTML). I looked at Stork, but it didn't look like it was processing these. Do you think it would be a good idea?
- embed a simple search, lazily, so the index is only fetched when you focus the search field
- ideally, <mark> the matches in HTML, in a similarly generator-agnostic way (although it might be trickier)
I ended up implementing my own via a relatively script + lunr.js, but I think if someone nailed such setup and made it really simple. It's a shame it's so tedious to add incremental search to a static blog/wiki.
P.S. demo on https://stork-search.net/ https://stork-search.net/ doesn't work for me now, I'm getting CORS error on fetching https://files.stork-search.net/federalist.st https://files.stork-search.net/federalist.st