1 | #!/usr/bin/env node
|
2 | import process from 'node:process';
|
3 | import {HugoIndexer} from './index.js';
|
4 |
|
5 | const help = `
|
6 | Creates lunr index file for multilingual hugo static site
|
7 |
|
8 | Usage:
|
9 |
|
10 | hugo-lunr-ml [arguments]
|
11 | or
|
12 | ./module_path/index.js
|
13 |
|
14 | Arguments:
|
15 |
|
16 | -i set input path to parse (default: content/**)
|
17 | -o set output index file path (default: /static/search/index.json')
|
18 | -ol set output lunr index file path (default: /static/search/lunr-index.json')
|
19 | -l set default language. will use this code ([.en, .ru etc] in the search json) (default: ru)
|
20 | `;
|
21 |
|
22 | if (process.argv.includes('--help')) {
|
23 | console.info(help);
|
24 | } else {
|
25 | new HugoIndexer().createIndex();
|
26 | }
|