feat(docs): 添加站点全文搜索功能#129
Merged
Merged
Conversation
- 新增 gen-search.mjs 构建时索引生成脚本 - 新增 DocSearch 组件(展开收起动画、键盘导航、高亮) - Header 集成搜索框(桌面端导航栏 / 移动端 drawer) - 添加 flexsearch 依赖 - 添加搜索 i18n 中英文文案 - Header 显示 @antdv-next/x 版本号 - 构建脚本 build 前自动生成搜索索引
This was referenced Jul 10, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
🤔 This is a ...
🔗 Related Issues
close #128
💡 Background and Solution
当前文档站点缺少跨页面全文搜索能力,用户无法在站内搜索文档内容 / 组件 / API。参考 antdv-next 主库的 flexsearch 方案移植,适配 antdv-next-x 的路由规则(英文
-en后缀)。实现方案:
gen-search.mjs扫描src/pages/**/*.{zh-CN,en-US}.md,用 markdown-it 解析 frontmatter/headers/title,按 H2/H3 切分 section,flexsearchDocument索引导出 JSON 到public/search.{cn,en}.json📝 Change Log