优化:使用 vitepress-plugin-pagefind 离线搜索插件替换 vitepress-plugin-search 插件,中文搜索相对友好一些(毕竟国人写的)

This commit is contained in:
2023-03-29 21:23:25 +08:00
parent 8af09b2b72
commit f7781ac328
5 changed files with 70 additions and 127 deletions

View File

@@ -65,7 +65,7 @@ pnpm build
- [x] ~~徽章:标题后可显示徽章,此功能来自于 VitePress 未合并的 PR如若后续被合并则改用官方主题功能[官方已合并于 v1.0.0-alpha.27](https://github.com/vuejs/vitepress/issues/1239)~~
- [x] 本地文档搜索支持VitePress 官方目前仅提供了对接 algolia 的在线搜索配置,而且对接起来的流程也较为麻烦。所幸寻到一个本地文档搜索插件 [emersonbottero/vitepress-plugin-search](https://github.com/emersonbottero/vitepress-plugin-search),如需体验,可将 `docs/vite.config.ts` 文件中的注释去除掉
- [x] 本地文档搜索支持VitePress 官方目前仅提供了对接 algolia 的在线搜索配置,而且对接起来的流程也较为麻烦。~~所幸寻到一个本地文档搜索插件 [emersonbottero/vitepress-plugin-search](https://github.com/emersonbottero/vitepress-plugin-search)。~~目前对接了 [vitepress-plugin-pagefind](https://www.npmjs.com/package/vitepress-plugin-pagefind) 本地搜索插件,中文搜索相对友好一些,如需体验,可将 `docs/vite.config.ts` 文件中的注释去除掉。目前 VitePress 官方有一个 PR 正在处理离线搜索功能,再过段时间应该就能合并了,到时候体验一下试试看
注意:本地文档搜索和 algolia 搜索无法同时使用,开启本地文档搜索后 algolia 搜索配置将不再生效。
@@ -121,7 +121,7 @@ pnpm build
![Mermaid流程图](./docs/public/screenshot/Mermaid流程图1.png)
![Mermaid流程图](./docs/public/screenshot/Mermaid流程图2.png)
##
## 特别鸣
- [vuejs/vitepress](https://github.com/vuejs/vitepress) (本知识库基于 VitePress 构建)
- [vitejs/vite](https://github.com/vitejs/vite) (参考主页美化)
@@ -134,7 +134,7 @@ pnpm build
- [xiaoxian521/pure-admin-utils-docs](https://github.com/xiaoxian521/pure-admin-utils-docs) (参考词云组件的使用)
- [arco-design/arco-design-vue](https://github.com/arco-design/arco-design-vue) (使用部分组件及图标)
- [antvis/G2plot](https://github.com/antvis/G2plot) (使用部分图表)
- [emersonbottero/vitepress-plugin-search](https://github.com/emersonbottero/vitepress-plugin-search) VitePress 本地文档搜索插件)
- [vitepress-plugin-pagefind](https://www.npmjs.com/package/vitepress-plugin-pagefind) VitePress 本地文档搜索插件,中文搜索相对友好一些
- [emersonbottero/vitepress-plugin-mermaid](https://github.com/emersonbottero/vitepress-plugin-mermaid) VitePress Mermaid 流程图插件)
- [mermaid-js/mermaid](https://github.com/mermaid-js/mermaid/blob/develop/README.zh-CN.md)
- ......