greenelab/lab-website-template

Site wide search?

Closed this issue · 3 comments

It may be possible to add an instant site-wide search component using Lunr. This would be a good feature to have if it's easy to implement, ie there is a third party library/plugin to do the heavy-lifting.

This can be done somewhat easily (though time consuming) using the method here, where you simply iterate through the site's content (the example only includes site.posts but you can iterate through all pages content too) using liquid and output/format it as a JSON file that can then be searched by javascript. However, since Google Site Search (already on the 404 page) can probably do a better job (albeit not as nicely integrated), and since no one has actually requested this yet, reverting this issue back to just an enhancement closing this issue.

This is made further unnecessary by an upcoming PR that makes the google site-wide search into its own component that the maintainer can put anywhere on the site.