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
Offline / local search for Docusaurus v2 that works behind your firewall.

Installation
yarn add @cmfcmf/docusaurus-search-localor
npm install @cmfcmf/docusaurus-search-localUsage
Add this plugin to the plugins array in docusaurus.config.js.
module.exports = {
// ...
plugins: [
require.resolve('@cmfcmf/docusaurus-search-local') // warning: Use '@cmfcmf/docusaurus-search-local' (without the require.resolve) if you use Docusaurus before v2.0.0-alpha.56
],
// or, if you want to specify options:
// ...
plugins: [
[require.resolve('@cmfcmf/docusaurus-search-local'), { // warning: Use '@cmfcmf/docusaurus-search-local' (without the require.resolve) if you use Docusaurus before v2.0.0-alpha.56
// 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, viDebugging
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