@jhvanderschee Hello, thank you for the quick solution. Though, I am not conversant with Jekyll, and also not familiar with Javascript, so cannot comment anything useful by just looking at the code.
(I can though try out something quickly if you present an example setup for Hugo.)
Reading through Search with Lunr.js | Jekyll Codex, I see:
First a local index is build, using the documents variable.
If I am not wrong, a Hugo-local index can be built during deployment using Custom Output Format JSON. I was able to achieve that part. Where I stumbled was where @bep referred to a “reverse document index” generation in this comment. I have no idea where that piece of code would go in the whole flow.
So my idea would be:
- Generate the JSON using Hugo Custom Output as explained here. I got this part working!
- ??? (The reverse index generation part)
- Download the file lunr.js
- Save the file in the ‘js’ (root) directory of your project
- Call the reverse index generation script by putting this partial in your HTML header template.
Thank you!