https://github.com/clarketm/hugo-lunr-indexer
Generate Lunr indexes for Hugo static sites by parsing front matter
https://github.com/clarketm/hugo-lunr-indexer
hugo index indexer indexing indexing-engine lunr toml yaml
Last synced: 6 months ago
JSON representation
Generate Lunr indexes for Hugo static sites by parsing front matter
- Host: GitHub
- URL: https://github.com/clarketm/hugo-lunr-indexer
- Owner: clarketm
- License: apache-2.0
- Created: 2017-07-20T01:49:02.000Z (about 8 years ago)
- Default Branch: master
- Last Pushed: 2022-12-09T05:37:32.000Z (almost 3 years ago)
- Last Synced: 2024-04-15T08:08:39.854Z (over 1 year ago)
- Topics: hugo, index, indexer, indexing, indexing-engine, lunr, toml, yaml
- Language: JavaScript
- Homepage: https://blog.travismclarke.com/project/hugo-lunr-indexer/
- Size: 395 KB
- Stars: 8
- Watchers: 3
- Forks: 0
- Open Issues: 7
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- awesome-starred - clarketm/hugo-lunr-indexer - Generate Lunr indexes for Hugo static sites by parsing front matter (others)
README
# [Hugo-Lunr-Indexer (HLI)](https://blog.travismclarke.com/project/hugo-lunr-indexer/)
[](https://www.npmjs.com/package/hugo-lunr-indexer)
[](https://circleci.com/gh/clarketm/hugo-lunr-indexer)
[](LICENSE.md)Generate [Lunr](https://lunrjs.com/) indexes for [Hugo](https://gohugo.io/) static sites by parsing front matter.
## Installation
#### Install with npm
```shell
$ npm install hugo-lunr-indexer
```## Usage
#### CLI
```shell
###################
# 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
```javascript
...
"scripts": {
"index": "hli -i 'content/posts/**' -o 'public/indices/lunr.json' -l 'yaml' -d '---'"
},
...
``````shell
$ npm run index
```#### API
```javascript
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](https://www.travismclarke.com/)