Skip to content

Commit

Permalink
docs(website): Add a local search plugin
Browse files Browse the repository at this point in the history
Add `@easyops-cn/docusaurus-search-local` [1] as a local search plugin
for Docusaurus.

Fixes #1673.

[1]: https://github.com/easyops-cn/docusaurus-search-local

Signed-off-by: Martin Nonnenmacher <[email protected]>
  • Loading branch information
mnonnenmacher committed Jan 15, 2025
1 parent 30e847b commit 07e67f2
Show file tree
Hide file tree
Showing 3 changed files with 465 additions and 26 deletions.
17 changes: 16 additions & 1 deletion website/docusaurus.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,22 @@ const config: Config = {
],
],

themes: ['@docusaurus/theme-mermaid', 'docusaurus-theme-openapi-docs'],
themes: [
'@docusaurus/theme-mermaid',
'docusaurus-theme-openapi-docs',
[
'@easyops-cn/docusaurus-search-local',
{
hashed: true,
indexBlog: false,
docsDir: ['api', 'docs'],
docsRouteBasePath: ['/api', '/docs'],
searchResultLimits: 15,
searchResultContextMaxLength: 200,
explicitSearchResultPath: true,
},
],
],

themeConfig: {
image: 'img/social-card.png',
Expand Down
1 change: 1 addition & 0 deletions website/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
"@docusaurus/preset-classic": "3.7.0",
"@docusaurus/theme-common": "3.7.0",
"@docusaurus/theme-mermaid": "3.7.0",
"@easyops-cn/docusaurus-search-local": "^0.48.0",
"@iconify/react": "^5.0.2",
"@mdx-js/react": "^3.0.0",
"clsx": "^2.0.0",
Expand Down
Loading

0 comments on commit 07e67f2

Please sign in to comment.