Product
Introducing SSO
Streamline your login process and enhance security by enabling Single Sign-On (SSO) on the Socket platform, now available for all customers on the Enterprise plan, supporting 20+ identity providers.
hugo-lunr
Advanced tools
Readme
A simple way to add site search to your static Hugo site using Lunr.js. Hugo-lunr will create an index file of any html and markdown documents in your Hugo project, only non-draft documents get added to the index.
Install the hugo-lunr utility via npm:
$ npm install hugo-lunr
By default hugo-lunr will read the content
directory of your Hugo project and output the lunr index to public/lunr.json
. If you are using the command line implementation you can pass an input directory -i
and and output path/file -o
.
The easiest way to use hugo-lunr is via npm scripts:
"scripts": {
"index": "hugo-lunr"
},
or to pass arguments for input and output:
"scripts": {
"index": "hugo-lunr -i \"content/subdir/**\" -o public/my-index.json"
},
Which can be executed from a terminal prompt
$ npm run index
var hugolunr = require('hugo-lunr');
new hugolunr().index();
or to set input/output paths
var hugolunr = require('hugo-lunr');
var h = new hugolunr();
h.setInput('content/faq/**');
h.setOutput('public/faq.json');
h.index();
Checkout this example page to see how to setup search using lunr.js on your website.
FAQs
Generate lunr.js index files for Hugo static site search
The npm package hugo-lunr receives a total of 271 weekly downloads. As such, hugo-lunr popularity was classified as not popular.
We found that hugo-lunr demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Product
Streamline your login process and enhance security by enabling Single Sign-On (SSO) on the Socket platform, now available for all customers on the Enterprise plan, supporting 20+ identity providers.
Security News
Tea.xyz, a crypto project aimed at rewarding open source contributions, is once again facing backlash due to an influx of spam packages flooding public package registries.
Security News
As cyber threats become more autonomous, AI-powered defenses are crucial for businesses to stay ahead of attackers who can exploit software vulnerabilities at scale.