跳到主要内容

docusaurus-search-local

2023年02月21日
柏拉文
越努力,越幸运

一、认识


easyops-cn/docusaurus-search-local 是一款支持本地/离线的搜索库

二、安装


npm install --save @easyops-cn/docusaurus-search-local
# or
yarn add @easyops-cn/docusaurus-search-local

三、配置


 themes: [
// ... Your other themes.
[
require.resolve("@easyops-cn/docusaurus-search-local"),
{
// ... Your options.
// `hashed` is recommended as long-term-cache of index file is possible.
hashed: true,
language: ["en", "zh"],
highlightSearchTermsOnTargetPage: true,
explicitSearchResultPath: true,
// For Docs using Chinese, The `language` is recommended to set to:
// ```
// language: ["en", "zh"],
// ```
},
]
],

参考资料


Docusaurus 社区项目的精选列表