Generate Lunr indexes for Hugo static sites by parsing front matter.
$ npm install hugo-lunr-indexer
###################
# Default options #
###################
$ hli \ # hli -> hugo-lunr-indexer
-i "content/**" \ # input (path)
-o "public/lunr.json" \ # output (path)
-l "toml" # language (toml | yaml)
-d "+++" # delimiter (toml: +++ | yaml: ---)
...
"scripts": {
"index": "hli -i 'content/posts/**' -o 'public/indices/lunr.json' -l 'yaml' -d '---'"
},
...
$ npm run index
var hli = require('hugo-lunr-indexer');
var Indexer = new hli();
Indexer.setInput('content/blog/**');
Indexer.setOutput('public/static/index.json');
Indexer.setLanguage('toml');
Indexer.setDelimiter('---');
Indexer.index();
Apache-2.0 © Travis Clarke