-
-
Notifications
You must be signed in to change notification settings - Fork 51
Description
The topic of search came up briefly in #360 (comment) and I'd like to spin it into a proper feature request.
@valencik and @samspills have been working hard on protosearch and friends which is a pure Scala search library. There are some demos, such as this http4s docs search embedded in an HTML page using a JS-exported API.
I've only been following along in awe, I'm not deeply versed in how it's all working unfortunately 😅
The high-level idea of protosearch is to:
- support indexing on the JVM
- support querying in the browser via JS (or one day WASM)
For Laika integration + deployment, one idea we've had is the following:
-
Indexing is implemented as a Laika renderer that produces an index artifact. This can be deployed as part of the site (similar to how e.g. epub / pdfs are included in the site).
-
protosearch publishes a JS library to NPM and is available via CDNs. This JS library can load an index file and run queries on it.
-
A search page is added to the site which uses a small bit of JS to glue together a search bar, the protosearch.js library, and index file.
This doesn't necessarily have to be something in the Laika core repository and there may be good reasons it shouldn't be. But it could exist as a separate project/plugin that is brought in by sbt-typelevel-site.
Discuss! 😇