This is an automated email from the ASF dual-hosted git repository.
zhangzhe pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/fesod.git
The following commit(s) were added to refs/heads/main by this push:
new b4d03b5e feat: add docusaurus-search-local plugin for search (#636)
b4d03b5e is described below
commit b4d03b5e28d6ddb4730e26a4643b187d5f5da2e3
Author: DeleiGuo <[email protected]>
AuthorDate: Fri Oct 10 21:10:48 2025 +0800
feat: add docusaurus-search-local plugin for search (#636)
---
website/docusaurus.config.js | 20 +++++++++++++++++++-
website/package.json | 1 +
website/src/css/custom.css | 4 ++++
3 files changed, 24 insertions(+), 1 deletion(-)
diff --git a/website/docusaurus.config.js b/website/docusaurus.config.js
index 83c22bd1..0ee421cc 100644
--- a/website/docusaurus.config.js
+++ b/website/docusaurus.config.js
@@ -206,7 +206,25 @@ const config = {
jsLoader: 'matomo.js',
}
}),
- themes: ['@docusaurus/theme-mermaid'],
+ themes: [
+ '@docusaurus/theme-mermaid',
+ [
+ require.resolve("@easyops-cn/docusaurus-search-local"),
+ /** @type
{import("@easyops-cn/docusaurus-search-local").PluginOptions} */
+ ({
+ hashed: true,
+ indexDocs: true,
+ indexBlog: true,
+ indexPages: true,
+ highlightSearchTermsOnTargetPage: false,
+ explicitSearchResultPath: true,
+ searchBarPosition: "right",
+ searchBarShortcutHint: false,
+ language: ["zh", "en"],
+ hideSearchBarWithNoSearchContext: true,
+ }),
+ ],
+ ],
headTags: [],
markdown: {
format: 'md',
diff --git a/website/package.json b/website/package.json
index feddbd1e..35f1099f 100644
--- a/website/package.json
+++ b/website/package.json
@@ -21,6 +21,7 @@
"@docusaurus/core": "^3.9.1",
"@docusaurus/preset-classic": "^3.9.1",
"@docusaurus/theme-mermaid": "^3.9.1",
+ "@easyops-cn/docusaurus-search-local": "^0.52.1",
"@mdx-js/react": "^3.0.0",
"clsx": "^2.0.0",
"docusaurus-plugin-matomo": "^0.0.8",
diff --git a/website/src/css/custom.css b/website/src/css/custom.css
index 07b47f31..6f3fce0a 100644
--- a/website/src/css/custom.css
+++ b/website/src/css/custom.css
@@ -28,6 +28,9 @@
--ifm-code-font-size: 95%;
--ifm-navbar-height: 80px;
--docusaurus-highlighted-code-line-bg: rgba(0, 0, 0, 0.1);
+ --search-local-modal-width: 480px;
+ --search-local-modal-width-sm: 300px;
+ --search-local-highlight-color: #2e8555;
}
/* For readability concerns, you should choose a lighter palette in dark mode.
*/
@@ -41,6 +44,7 @@
--ifm-color-primary-lightest: #4fddbf;
--ifm-footer-background-color: #242526;
--docusaurus-highlighted-code-line-bg: rgba(0, 0, 0, 0.3);
+ --search-local-highlight-color: #25c2a0;
}
.hero {
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]