UNPKG

674 BJavaScriptView Raw
1#!/usr/bin/env node
2import process from 'node:process';
3import {HugoIndexer} from './index.js';
4
5const help = `
6Creates lunr index file for multilingual hugo static site
7
8Usage:
9
10 hugo-lunr-ml [arguments]
11 or
12 ./module_path/index.js
13
14Arguments:
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
22if (process.argv.includes('--help')) {
23 console.info(help);
24} else {
25 new HugoIndexer().createIndex();
26}