Table of Contents
Configure Lunr.js Search Client
Select Lunr.js as the search client in your
[params.search] client = "lunr"
Generate Search Index for Lunr.js
Lunr.js will need a search index for searching across your site. So, you’ll need to generate that search index for Lunr.js before you deploy your site.
Minimo comes with a script for generating the search index for Lunr.js:
Node.js must be installed on your system for using the generator script.
It also need the following npm packages:
glob globally use the following command:
npm install -g lunr glob
Run the Script
After you’ve generated your site with Hugo, run
If Minimo is installed under
/themes/minimo directory, you’ll run it as:
generate-search-index-lunr.js script accepts an optional argument for Hugo’s
publishDir (relative to your site’s root directory).
So, if you’ve got a different
site), pass it as the first argument:
node ./themes/minimo/scripts/generate-search-index-lunr.js site
If the generation was successful, you’ll see output like this:
Lunr.js Index Generated for: /search/index.json
That’s all. Now you can deploy your site.