Skip to content

feat(search): integrate local search functionality and update search UI components - #332

Open
neiljar wants to merge 1 commit into
kmesh-net:mainfrom
neiljar:new-search-neil
Open

feat(search): integrate local search functionality and update search UI components#332
neiljar wants to merge 1 commit into
kmesh-net:mainfrom
neiljar:new-search-neil

Conversation

@neiljar

@neiljar neiljar commented Jul 16, 2026

Copy link
Copy Markdown
Contributor

fixes #331

Summary

  • Replace docusaurus-lunr-search with @easyops-cn/docusaurus-search-local
  • Wire navbar search and Chinese search UI strings

Test plan

  • npm run build && npm run serve
  • Search for “Quick” / “Rate Limit” — results are clean, no repeated titles
  • Confirm EN and ZH search both work

Before ->

Screenshot 2026-07-16 at 09 26 16

After ->

Screenshot 2026-07-16 at 09 45 50

Copilot AI review requested due to automatic review settings July 16, 2026 04:22
@netlify

netlify Bot commented Jul 16, 2026

Copy link
Copy Markdown

Deploy Preview for kmesh-net ready!

Name Link
🔨 Latest commit 6370fcf
🔍 Latest deploy log https://app.netlify.com/projects/kmesh-net/deploys/6a7205eda58e2f0008f4f3a9
😎 Deploy Preview https://deploy-preview-332--kmesh-net.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@kmesh-bot

Copy link
Copy Markdown
Collaborator

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:
Once this PR has been reviewed and has the lgtm label, please assign lizhencheng9527 for approval. For more information see the Kubernetes Code Review Process.

The full list of commands accepted by this bot can be found here.

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@kmesh-bot

Copy link
Copy Markdown
Collaborator

Welcome @neiljar! It looks like this is your first PR to kmesh-net/website 🎉

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request replaces the docusaurus-lunr-search plugin with @easyops-cn/docusaurus-search-local to handle local search functionality, adds a search bar to the navbar, and provides Chinese translations for the search interface. The feedback suggests removing leading slashes from the docsRouteBasePath and blogRouteBasePath configurations to avoid potential path resolution issues during build or search indexing.

Important

The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.

Comment thread docusaurus.config.js
Comment on lines +222 to +223
docsRouteBasePath: "/docs",
blogRouteBasePath: "/blog",

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

In Docusaurus, route base paths are resolved relative to the baseUrl and should not contain leading slashes. Specifying "/docs" and "/blog" with leading slashes can lead to path resolution issues (such as double slashes like //docs or route mismatch) during the build or search indexing process.\n\nPlease remove the leading slashes so they match the default Docusaurus route base paths ("docs" and "blog").

Suggested change
docsRouteBasePath: "/docs",
blogRouteBasePath: "/blog",
docsRouteBasePath: "docs",
blogRouteBasePath: "blog",

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR switches the Docusaurus site from docusaurus-lunr-search to @easyops-cn/docusaurus-search-local, adds a navbar search entry, and updates Chinese (ZH) UI strings to support the new search UI.

Changes:

  • Replace docusaurus-lunr-search with @easyops-cn/docusaurus-search-local and update the Docusaurus plugin configuration.
  • Add a type: "search" navbar item to surface search in the header.
  • Add ZH translation strings for the new Search page and Search bar UI.

Reviewed changes

Copilot reviewed 3 out of 4 changed files in this pull request and generated no comments.

File Description
package.json Removes docusaurus-lunr-search and adds @easyops-cn/docusaurus-search-local.
docusaurus.config.js Adds navbar search item and wires the local search plugin configuration.
i18n/zh/code.json Adds required search-related ZH UI strings for Search page/bar.
yarn.lock Updates dependency graph for the new search plugin and related transitive deps.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@yashisrani

Copy link
Copy Markdown
Contributor

@neiljar please fix this build issues..

Copilot AI review requested due to automatic review settings July 20, 2026 16:35

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 3 out of 4 changed files in this pull request and generated 4 comments.

Comment thread package.json
Comment on lines +22 to 25
"@easyops-cn/docusaurus-search-local": "^0.55.2",
"@mdx-js/react": "^3.0.0",
"@node-rs/jieba": "^2.0.1",
"clsx": "^2.0.0",
Comment thread docusaurus.config.js
Comment on lines +220 to +229
require.resolve("@easyops-cn/docusaurus-search-local"),
{
languages: ["en",'zh'],
indexDocs: true,
indexBlog: true,
indexPages: false,
}
docsRouteBasePath: "/docs",
blogRouteBasePath: "/blog",
language: ["en", "zh"],
hashed: true,
highlightSearchTermsOnTargetPage: true,
explicitSearchResultPath: true,
indexPages: true,
},
Comment thread i18n/zh/code.json
Comment on lines +405 to +407
"theme.SearchPage.searchContext.everywhere": {
"message": "所有"
},
Comment thread i18n/zh/code.json
Comment on lines +416 to +421
"theme.SearchBar.noResultsText": {
"message": "没有找到任何文档"
},
"theme.SearchBar.seeAllOutsideContext": {
"message": "查看“{context}”以外的全部结果"
},
…UI components

Signed-off-by: Yash <neiljar888@gmail.com>
@neiljar

neiljar commented Aug 4, 2026

Copy link
Copy Markdown
Contributor Author

@yashisrani fixed please check.

@easyops-cn/docusaurus-search-local pulls cheerio@1.2.0, which requires
Node >= 20.18.1.

@yashisrani

Copy link
Copy Markdown
Contributor

/lgtm

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Duplicate search results in documentation

4 participants