新增:通过 vitepress-plugin-search 实现本地文档搜索支持(需要在 vite.config.ts 中启用)
This commit is contained in:
23
README.md
23
README.md
@@ -42,19 +42,32 @@ pnpm build
|
||||
## 已扩展功能(持续优化细节)
|
||||
|
||||
- [x] 拆分配置文件:解决“大”配置文件问题,提取公有配置选项进行复用,方便维护
|
||||
|
||||
- [x] GitHub Actions:push 到 GitHub,自动进行项目打包及 GitHub Pages 部署,并同步到 Gitee Pages(可根据个人需要自行删减同步 Gitee Pages 部分工作流配置)
|
||||
|
||||
- [x] 自动生成侧边栏:将文章按规律性目录存放后,侧边栏将自动生成,支持文章置顶🔝(在文章 frontmatter 中配置 `isTop: true`,即可在侧边栏自动出现置顶分组)
|
||||
|
||||
- [x] 主页美化:参照 vite 文档主页进行美化
|
||||
|
||||
- [x] 自定义页脚:支持ICP备案号、公安备案号、版权信息配置(符合大陆网站审核要求)
|
||||
|
||||
- [x] 文章元数据信息显示:文章标题下显示作者、发布时间、所属分类、标签列表等信息,可全局配置作者及作者主页信息
|
||||
|
||||
- [x] 《我的标签》:模仿语雀标签页风格,另有标签云展示。语雀标签页地址:https://www.yuque.com/r/语雀用户名/tags?tag=
|
||||
|
||||
- [x] 《我的归档》:自定义时间轴,展示历史文章数据。年份前可展示生肖,还可按分类、标签筛选
|
||||
|
||||
- [x] 文章评论:目前仅支持Gitalk
|
||||
|
||||
- [x] 版权声明:文末显示文章版权声明,可自由配置采用的版权协议
|
||||
|
||||
- [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` 文件中的注释去除掉。
|
||||
|
||||
注意:本地文档搜索和 algolia 搜索无法同时使用,开启本地文档搜索后 algolia 搜索配置将不再生效。
|
||||
|
||||
- [x] Mermaid 流程图:在 Markdown 中绘制流程图、状态图、时序图、甘特图、饼图等,更多语法请参见:[Mermaid 官方文档](https://github.com/mermaid-js/mermaid/blob/develop/README.zh-CN.md) 。(Typora 编辑器也支持 `mermaid` 语法)
|
||||
- [ ] 本地搜索:等待 [emersonbottero/vitepress-plugin-search](https://github.com/emersonbottero/vitepress-plugin-search) 作者修复中文检索问题
|
||||
- [ ] 如需体验,可将 `docs/vite.config.ts` 文件中的注释去除掉(本地搜索和 algolia 搜索无法同时使用,开启本地搜索后 algolia 搜索配置将不再生效)
|
||||
|
||||
- [x] 更多细节优化:敬请发现
|
||||
- [x] 文章内图片增加圆角样式优化([#56](https://github.com/Charles7c/charles7c.github.io/issues/56))
|
||||
@@ -96,6 +109,10 @@ pnpm build
|
||||
|
||||

|
||||
|
||||
### 本地文档搜索
|
||||
|
||||

|
||||
|
||||
### Mermaid 流程图
|
||||
|
||||

|
||||
@@ -114,9 +131,9 @@ 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 本地文档搜索插件)
|
||||
- [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)
|
||||
- [emersonbottero/vitepress-plugin-search](https://github.com/emersonbottero/vitepress-plugin-search) (VitePress 本地搜索插件)
|
||||
- ......
|
||||
|
||||
## License
|
||||
|
BIN
docs/public/img/2022/10/25/202210252119166.png
Normal file
BIN
docs/public/img/2022/10/25/202210252119166.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 14 KiB |
BIN
docs/public/screenshot/本地文档搜索.png
Normal file
BIN
docs/public/screenshot/本地文档搜索.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 274 KiB |
@@ -5,7 +5,10 @@ import { ArcoResolver } from 'unplugin-vue-components/resolvers'
|
||||
|
||||
export default defineConfig({
|
||||
plugins: [
|
||||
// SearchPlugin({}),
|
||||
//SearchPlugin({
|
||||
//encode: false,
|
||||
//tokenize: 'full'
|
||||
//}),
|
||||
Components({
|
||||
dirs: ['.vitepress/theme/components'],
|
||||
include: [/\.vue$/, /\.vue\?vue/, /\.md$/],
|
||||
|
Reference in New Issue
Block a user