検索機能をつける
インストール+設定
ローカルサーチというのであれば外部ライブラリから使用可能
bash
npm install --save @easyops-cn/docusaurus-search-local
docusaurus.config.ts
const config: Config = {
...
themes: [
...
// ----- ↓ 追加 --------
[
'@easyops-cn/docusaurus-search-local',
{
hashed: true,
docsRouteBasePath: '/',
language: ['en', 'ja'],
highlightSearchTermsOnTargetPage: true,
explicitSearchResultPath: true,
indexPages: true,
searchResultLimits: 10,
}
],
],
};
→ これで、検索ボックスが出れば OK