feat(search): integrate local search functionality and update search UI components - #332
feat(search): integrate local search functionality and update search UI components#332neiljar wants to merge 1 commit into
Conversation
✅ Deploy Preview for kmesh-net ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
|
Welcome @neiljar! It looks like this is your first PR to kmesh-net/website 🎉 |
There was a problem hiding this comment.
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.
| docsRouteBasePath: "/docs", | ||
| blogRouteBasePath: "/blog", |
There was a problem hiding this comment.
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").
| docsRouteBasePath: "/docs", | |
| blogRouteBasePath: "/blog", | |
| docsRouteBasePath: "docs", | |
| blogRouteBasePath: "blog", |
There was a problem hiding this comment.
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-searchwith@easyops-cn/docusaurus-search-localand 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.
|
@neiljar please fix this build issues.. |
| "@easyops-cn/docusaurus-search-local": "^0.55.2", | ||
| "@mdx-js/react": "^3.0.0", | ||
| "@node-rs/jieba": "^2.0.1", | ||
| "clsx": "^2.0.0", |
| 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, | ||
| }, |
| "theme.SearchPage.searchContext.everywhere": { | ||
| "message": "所有" | ||
| }, |
| "theme.SearchBar.noResultsText": { | ||
| "message": "没有找到任何文档" | ||
| }, | ||
| "theme.SearchBar.seeAllOutsideContext": { | ||
| "message": "查看“{context}”以外的全部结果" | ||
| }, |
…UI components Signed-off-by: Yash <neiljar888@gmail.com>
95a9a78 to
6370fcf
Compare
|
@yashisrani fixed please check.
|
|
/lgtm |
fixes #331
Summary
docusaurus-lunr-searchwith@easyops-cn/docusaurus-search-localTest plan
npm run build && npm run serveBefore ->
After ->