Socket
Socket
Sign inDemoInstall

hugo-lunr

Package Overview
Dependencies
24
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    hugo-lunr

create lunr index file for hugo static site search


Version published
Weekly downloads
130
increased by51.16%
Maintainers
1
Install size
1.48 MB
Created
Weekly downloads
 

Readme

Source

hugo-lunr

Generate lunr.js index files from Hugo static sites

A simple way to add site search to your static Hugo site using Lunr.js.

Installation

Install the hugo-lunr utility via npm:

$ npm install hugo-lunr

Options

By default hugo-lunr will read the content directory of you 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.

How to use hugo-lunr CLI

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

How to use hugo-lunr API

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();

FAQs

Last updated on 16 Feb 2016

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.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc