How to implement a custom search for Hugo usig Gruntjs and Lunrjs.
Install the following tools:
//vanilla js version of https://gist.github.com/sebz/efddfc8fdcb6b480f567 | |
var lunrIndex, | |
$results, | |
pagesIndex; | |
// Initialize lunrjs using our generated index file | |
function initLunr() { | |
var request = new XMLHttpRequest(); | |
request.open('GET', 'js/lunr/index.json', true); |