hugo-lunr-indexer

1.1.3 • Public • Published

Hugo-Lunr-Indexer (HLI)

NPM release Build Status License

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

License

Apache-2.0 © Travis Clarke

Package Sidebar

Install

npm i hugo-lunr-indexer

Weekly Downloads

12,961

Version

1.1.3

License

Apache-2.0

Unpacked Size

217 kB

Total Files

24

Last publish

Collaborators

  • clarketm