hugo-lunr-indexer
v1.1.3
Published
Generate Lunr indices for Hugo static sites by parsing front matter.
Downloads
82,055
Maintainers
Readme
Hugo-Lunr-Indexer (HLI)
Generate Lunr indexes for Hugo static sites by parsing front matter.
Installation
Install with npm
$ npm install hugo-lunr-indexer
Usage
CLI
###################
# 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: ---)
NPM Scripts
...
"scripts": {
"index": "hli -i 'content/posts/**' -o 'public/indices/lunr.json' -l 'yaml' -d '---'"
},
...
$ npm run index
API
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();
Sites using hugo-lunr-indexer
- https://blog.travismclarke.com/
License
Apache-2.0 © Travis Clarke