1.1.3 • Published 5 years ago

hugo-lunr-indexer v1.1.3

Weekly downloads
2
License
Apache-2.0
Repository
github
Last release
5 years ago

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

1.1.3

5 years ago

1.1.2

6 years ago

1.1.1

7 years ago

1.1.0

7 years ago

1.0.0

7 years ago