From 221baae8c761d40199f9099e8818ab27c8b18893 Mon Sep 17 00:00:00 2001 From: Charles7c Date: Fri, 4 Nov 2022 15:01:48 +0800 Subject: [PATCH] =?UTF-8?q?=E5=8D=87=E7=BA=A7=EF=BC=9A=E5=B0=86=20VitePres?= =?UTF-8?q?s=20=E7=89=88=E6=9C=AC=E5=8D=87=E7=BA=A7=E4=B8=BA=20v1.0.0-alph?= =?UTF-8?q?a.27=EF=BC=88=E5=88=A0=E9=99=A4=E8=87=AA=E5=AE=9A=E4=B9=89=20Ba?= =?UTF-8?q?dge=20=E7=BB=84=E4=BB=B6=E6=9B=B4=E6=8D=A2=E4=B8=BA=E5=AE=98?= =?UTF-8?q?=E6=96=B9=E5=85=A8=E5=B1=80=E7=BB=84=E4=BB=B6=EF=BC=8C=E8=B0=83?= =?UTF-8?q?=E6=95=B4=20cleanUrls=20=E9=85=8D=E7=BD=AE=EF=BC=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 7 +- collect-article-data.mjs | 2 +- docs/.vitepress/config.ts | 4 +- docs/.vitepress/config/nav.ts | 4 +- docs/.vitepress/config/theme.ts | 2 +- docs/.vitepress/theme/components/Archive.vue | 22 ++--- .../theme/components/ArticleMetadata.vue | 4 +- docs/.vitepress/theme/components/Badge.vue | 49 ----------- docs/.vitepress/theme/index.ts | 7 +- docs/.vitepress/theme/styles/vars.css | 37 -------- .../fragments/2019/12/28/个人SQL优化技巧.md | 4 +- .../2019/12/29/个人常用Stream使用技巧.md | 4 +- .../2019/12/30/个人常用Hutool工具类.md | 4 +- .../fragments/2019/12/31/个人常用Linux命令.md | 2 +- .../2022/10/01/个人常用Docker命令.md | 4 +- .../fragments/2022/10/05/个人常用Git命令.md | 4 +- .../2022/11/01/使用IDEA进行远程程序调试.md | 2 +- .../categories/tools/2021/01/14/初识Lombok.md | 6 +- .../tools/2021/02/22/RDM快速入门.md | 4 +- .../tools/2021/03/04/ARDM快速入门.md | 4 +- .../tools/2021/03/06/Postman快速入门.md | 4 +- .../tools/2021/03/10/Quartz快速入门.md | 4 +- docs/index.md | 2 +- docs/public/screenshot/徽章.png | Bin 214800 -> 0 bytes docs/vite.config.ts | 2 +- package.json | 9 +- pnpm-lock.yaml | 83 +++++++++++------- 27 files changed, 108 insertions(+), 172 deletions(-) delete mode 100644 docs/.vitepress/theme/components/Badge.vue delete mode 100644 docs/public/screenshot/徽章.png diff --git a/README.md b/README.md index c95bf1d6b..b0edb79e0 100644 --- a/README.md +++ b/README.md @@ -51,7 +51,7 @@ pnpm build - [x] 《我的归档》:自定义时间轴,展示历史文章数据。年份前可展示生肖,还可按分类、标签筛选 - [x] 文章评论:目前仅支持Gitalk - [x] 版权声明:文末显示文章版权声明,可自由配置采用的版权协议 -- [x] 徽章:标题后可显示徽章,此功能来自于 VitePress 未合并的 PR,如若后续被合并,则改用官方主题功能 +- [x] ~~徽章:标题后可显示徽章,此功能来自于 VitePress 未合并的 PR,如若后续被合并,则改用官方主题功能([官方已合并于 v1.0.0-alpha.27](https://github.com/vuejs/vitepress/issues/1239))~~ - [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 搜索配置将不再生效) @@ -96,10 +96,6 @@ pnpm build ![版权声明](./docs/public/screenshot/版权声明.png) -### 徽章 - -![徽章](./docs/public/screenshot/徽章.png) - ### Mermaid 流程图 ![Mermaid流程图](./docs/public/screenshot/Mermaid流程图1.png) @@ -118,7 +114,6 @@ 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) (使用部分图表) -- [richardo2016/vitepress-pr](https://github.com/vuejs/vitepress/pull/1134) (使用徽章) - [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 本地搜索插件) diff --git a/collect-article-data.mjs b/collect-article-data.mjs index 4187084c3..fd82448fa 100644 --- a/collect-article-data.mjs +++ b/collect-article-data.mjs @@ -12,7 +12,7 @@ const articleData = await Promise.all( const { data, path } = file return { ...data, - path: path.replace(/\.md$/, '.html').replace('./docs/', '') + path: path.replace(/\.md$/, '').replace('./docs/', '') } }) ) diff --git a/docs/.vitepress/config.ts b/docs/.vitepress/config.ts index 9b9f334d3..474501a11 100644 --- a/docs/.vitepress/config.ts +++ b/docs/.vitepress/config.ts @@ -11,8 +11,10 @@ export default withMermaid( title: metaData.title, description: metaData.description, - head, // 内标签配置 + cleanUrls: 'without-subfolders', lastUpdated: true, // 显示最后更新时间 + + head, // 内标签配置 markdown: markdown, // Markdown配置 themeConfig // 主题配置 }) diff --git a/docs/.vitepress/config/nav.ts b/docs/.vitepress/config/nav.ts index dd575f198..974141b2c 100644 --- a/docs/.vitepress/config/nav.ts +++ b/docs/.vitepress/config/nav.ts @@ -33,8 +33,8 @@ export const nav: DefaultTheme.Config['nav'] = [ { text: '关于', items: [ - { text: '关于知识库', link: '/about/index', activeMatch: '/about/index.html' }, - { text: '关于我', link: '/about/me', activeMatch: '/about/me.html' } + { text: '关于知识库', link: '/about/index', activeMatch: '/about/index' }, + { text: '关于我', link: '/about/me', activeMatch: '/about/me' } ], activeMatch: '/about/' // // 当前页面处于匹配路径下时, 对应导航菜单将突出显示 } diff --git a/docs/.vitepress/config/theme.ts b/docs/.vitepress/config/theme.ts index 84986fc3d..f29732f41 100644 --- a/docs/.vitepress/config/theme.ts +++ b/docs/.vitepress/config/theme.ts @@ -17,7 +17,7 @@ export const themeConfig: DefaultTheme.Config = { }, // 编辑链接配置 editLink: { - pattern: 'https://github.com/Charles7c/charles7c.github.io/edit/main/repos/:path', + pattern: 'https://github.com/Charles7c/charles7c.github.io/edit/main/docs/:path', text: '不妥之处,敬请雅正' }, // 全文搜索配置 diff --git a/docs/.vitepress/theme/components/Archive.vue b/docs/.vitepress/theme/components/Archive.vue index 2d7b074f9..3428276b2 100644 --- a/docs/.vitepress/theme/components/Archive.vue +++ b/docs/.vitepress/theme/components/Archive.vue @@ -6,7 +6,7 @@ v-if="$category" class="content" closable - @close="goToLink('/archives.html')" + @close="goToLink('/archives')" >