Offline search component for Docusaurus V2 Korean supported
npm install docusaurus-lunr-search-koModification of docusaurus-lunr-search
Thanks to : @eastuni/lunr-languages-ko
Similar Plugin
https://github.com/easyops-cn/docusaurus-search-local



worker_thread is needed, suggested node version > 12.Xdocusaurus-lunr-search version 2.1.0npm i docusaurus-lunr-search@2.1.0)
yarn add docusaurus-lunr-search-ko
`
2. Then run npm install to update, build, and link the packages
`
yarn install
`
3. Add the docusaurus-lunr-search-ko plugin to your docusaurus.config.js
`
module.exports = {
// ...
plugins: [require.resolve('docusaurus-lunr-search-ko')],
}
`
4. Then run docusaurus swizzle
`
yarn run swizzle docusaurus-lunr-search-ko SearchBar -- --danger
`
5. Then build your Docusaurus project
`
yarn build
`
6. 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.
Language options
`
module.exports = {
// ...
plugins: [[ require.resolve('docusaurus-lunr-search-ko'), {
languages: ['en', 'ko'] // language codes
}]],
}
`
Supports all the language listed here https://github.com/eastuni/lunr-languagesOther options
$3
You can exclude certain routes from the search by using this option:
`
module.exports = {
// ...
plugins: [
[require.resolve('docusaurus-lunr-search-ko'), {
excludeRoutes: [
'docs/changelogs/*/', // exclude changelogs from indexing
]
}]
],
}
`
$3
Base url will not indexed by default, if you want to index the base url set this option to true
`
module.exports = {
// ...
plugins: [
[require.resolve('docusaurus-lunr-search-ko'),
{
indexBaseUrl: true
}
]
],
}
`
Thanks to algolia/docsearch.js`, I modified it to create this search component And thanks cmfcmf, I used the code from his library docusaurus-search-local for multi-language support.