docusaurus-lunr-search
Offline Search for Docusaurus V2
Demo Website
Sample
How to Use ?
- Install this package
npm i docusaurus-lunr-search --save
//OR
npm i docusurus-lunr-search --save // Depreciated
- Then run docusaurus swizzle
npm run swizzle docusaurus-lunr-search SearchBar
- Add the docusaurus-lunr-search plugin to your
docusaurus.config.js
module.exports = {
// ...
plugins: [
'docusaurus-lunr-search'
]
}
- Then build your Docusaurus 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.
Thanks to algolia/docsearch.js
, I modified it to create this search component