docusurus-lunr-search
Offline Search for Docusurus V2
How to Use ?
- Install this package
npm i docusurus-lunr-search --save
- Then run docusurus swizzle
npm run swizzle docusurus-lunr-search SearchBar
- Add the docusurus-lunr-search plugin to your
docusaurus.config.js
module.exports = {
// ...
plugins: [
'docusurus-lunr-search'
]
}
- Then build your Docusurus project
npm run build
- Serve your application
npx http-server ./build
Note: Docusaurus search information can only be generated from a production build. Local development is currently not supported.
Sample
Thanks to algolia/docsearch.js
, I modified it to create this search component