JSPM

  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 28764
  • Score
    100M100P100Q174422F
  • License MIT

Local / Offline Search for Docusaurus

Package Exports

  • @cmfcmf/docusaurus-search-local

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (@cmfcmf/docusaurus-search-local) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

Offline / Local Search for Docusaurus v2

Version License code style: prettier GitHub issues GitHub last commit

Offline / local search for Docusaurus v2 that works behind your firewall.

Search in Action

Installation

yarn add @cmfcmf/docusaurus-search-local

or

npm install @cmfcmf/docusaurus-search-local

Usage

Add this plugin to the plugins array in docusaurus.config.js.

module.exports = {
  // ...
  plugins: [
    '@cmfcmf/docusaurus-search-local'
  ],

  // or, if you want to specify options:

  // ...
  plugins: [
    ['@cmfcmf/docusaurus-search-local', {
      // Options here
    }]
  ],
}

The following options are available (defaults are shown below):

{
  blogBasePath: '/blog', // must correspond to the base path configured for the blog plugin
  docsBasePath: '/docs', // must correspond to the base path configured for the docs plugin
  indexBlog: true, // whether to index blog pages
  indexDocs: true, // whether to index docs pages
  indexPages: false, // whether to index static pages
  // /404.html is never indexed
  language: "en" // language of your documentation, see next section
}

You can now use the search bar to search your documentation.

Important: Search only works for the statically built documentation (i.e., after you ran yarn build in your documentation folder).

Search does not work in development (i.e., when running yarn start).

Non-English Documentation

Use the language option if your documentation is not written in English. You can either specify a single language or an array of multiple languages. The following languages are available:

ar, da, de, en, es, fi, fr, hu, it, ja, nl, no, pt, ro, ru, sv, th, tr, vi

Debugging

If building your documentation produces an error, you can build it in debug mode to figure out which page is causing it. To do so, simply set the DEBUG environment variable when building your documentation: DEBUG=1 yarn build.

CONTRIBUTING

Please see the CONTRIBUTING.md file for further information.

License

MIT