feat(docs): add local search to Docusaurus site

Add @easyops-cn/docusaurus-search-local (v0.55.1) for offline/local
full-text search across all documentation pages.

- Search bar appears in the navbar (Ctrl/Cmd+K shortcut)
- Builds a search index at build time — no external service needed
- Highlights matched terms on target page after clicking a result
- Dedicated /search page for expanded results
- Blog indexing disabled (blog is off)
- docsRouteBasePath set to '/' to match existing docs routing
This commit is contained in:
teknium1
2026-03-12 08:15:05 -07:00
parent bb7cdc6d44
commit 6b211bf008
3 changed files with 560 additions and 0 deletions

View File

@@ -26,6 +26,20 @@ const config: Config = {
locales: ['en'],
},
themes: [
[
require.resolve('@easyops-cn/docusaurus-search-local'),
/** @type {import("@easyops-cn/docusaurus-search-local").PluginOptions} */
({
hashed: true,
language: ['en'],
indexBlog: false,
docsRouteBasePath: '/',
highlightSearchTermsOnTargetPage: true,
}),
],
],
presets: [
[
'classic',