weixsong / elasticlunr.js

Based on lunr.js, but more flexible and customized.
http://elasticlunr.com
MIT License
2.02k stars 147 forks source link

single page simple example? #131

Open jskye opened 2 years ago

jskye commented 2 years ago

would be good if there was an example of using this on a single static html page.

without the overhead of the http-requests/server/api.

im sure i can get your example working if i spin up an express server.

but getting libraries to play nicely with just a http node server is not fun. and your example even has another layer of abstraction with the template engine. Your example needs to retrieve the json from the server.

these things make it more complex for someone not versed in these libraries (but with a good use case) to bootstrap.

since one of the goals of the library is to be able to use on static pages, it would be good to just be able to include the library script and use it as is. it sounds like you can, but theres not an example for this. the example is more complex with the server, require, json, templates.

veleek commented 2 years ago

Would be totally reasonable to include something in the documentation, but in the meantime I used this guide for integrating it into a static site and it worked great for me.

https://www.belter.io/eleventy-search/