From 2a72477b6cbb7faee419be57472c430c0856e0ba Mon Sep 17 00:00:00 2001 From: ZiuChen Date: Sun, 23 Apr 2023 16:01:49 +0800 Subject: [PATCH] =?UTF-8?q?chore:=20=E7=B2=BE=E7=AE=80Vitepress=E9=85=8D?= =?UTF-8?q?=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- docs/.vitepress/config.ts | 52 +++++++--------------------------- docs/.vitepress/const/icons.ts | 1 + docs/.vitepress/const/index.ts | 2 ++ docs/.vitepress/const/links.ts | 20 +++++++++++++ 4 files changed, 34 insertions(+), 41 deletions(-) create mode 100644 docs/.vitepress/const/icons.ts create mode 100644 docs/.vitepress/const/index.ts create mode 100644 docs/.vitepress/const/links.ts diff --git a/docs/.vitepress/config.ts b/docs/.vitepress/config.ts index c4d4e73c..b8f86643 100644 --- a/docs/.vitepress/config.ts +++ b/docs/.vitepress/config.ts @@ -1,5 +1,6 @@ import { defineConfig } from 'vitepress' import generateSideBar from './scripts/generateSideBar' +import { projects, works, notes, JUEJIN } from './const' export default defineConfig({ title: 'ZiuChen', @@ -16,29 +17,15 @@ export default defineConfig({ { text: '首页', link: '/' }, { text: '我的项目', - items: [ - { text: '超级剪贴板', link: '/project/ClipboardManager/' }, - { text: '超级Markdown', link: '/project/Markdown/' }, - { text: '超级JavaScript', link: '/project/JSRunner/' }, - { text: '超级分词', link: '/project/SmartWordBreak/' } - ] + items: projects }, { text: '开源作品', - items: [ - { text: '个人作品', link: '/works/opensource' }, - { text: '社区贡献', link: '/works/contribution' } - ] + items: works }, { text: '学习笔记', - items: [ - { text: 'JavaScript基础', link: '/note/JavaScript' }, - { text: 'CSS基础', link: '/note/CSS' }, - { text: 'JavaScript进阶', link: '/note/JavaScriptEnhanced' }, - { text: '前端工程化', link: '/note/Front-end Engineering' }, - { text: '服务端渲染', link: '/note/SSR' } - ] + items: notes }, { text: '个人介绍', @@ -48,45 +35,28 @@ export default defineConfig({ sidebar: [ { text: '我的项目', - collapsible: true, - items: [ - { text: '超级剪贴板', link: '/project/ClipboardManager/' }, - { text: '超级Markdown', link: '/project/Markdown/' }, - { text: '超级JavaScript', link: '/project/JSRunner/' }, - { text: '超级分词', link: '/project/SmartWordBreak/' } - ] + items: projects }, { text: '开源作品', - collapsible: true, - items: [ - { text: '个人作品', link: '/works/opensource' }, - { text: '社区贡献', link: '/works/contribution' } - ] + collapsed: true, + items: works }, { text: '文章归档', - collapsible: true, + collapsed: true, items: [...generateSideBar()] }, { text: '学习笔记', - collapsible: true, - items: [ - { text: 'JavaScript基础', link: '/note/JavaScript' }, - { text: 'CSS基础', link: '/note/CSS' }, - { text: 'JavaScript进阶', link: '/note/JavaScriptEnhanced' }, - { text: '前端工程化', link: '/note/Front-end Engineering' }, - { text: '服务端渲染', link: '/note/SSR' } - ] + collapsed: true, + items: notes } ], socialLinks: [ { icon: 'github', link: 'https://github.com/ZiuChen' }, { - icon: { - svg: '' - }, + icon: { svg: JUEJIN }, link: 'https://juejin.cn/user/1887205216238477' } ], diff --git a/docs/.vitepress/const/icons.ts b/docs/.vitepress/const/icons.ts new file mode 100644 index 00000000..f9103de4 --- /dev/null +++ b/docs/.vitepress/const/icons.ts @@ -0,0 +1 @@ +export const JUEJIN = `` diff --git a/docs/.vitepress/const/index.ts b/docs/.vitepress/const/index.ts new file mode 100644 index 00000000..294ec73e --- /dev/null +++ b/docs/.vitepress/const/index.ts @@ -0,0 +1,2 @@ +export * from './links' +export * from './icons' diff --git a/docs/.vitepress/const/links.ts b/docs/.vitepress/const/links.ts new file mode 100644 index 00000000..599fa8df --- /dev/null +++ b/docs/.vitepress/const/links.ts @@ -0,0 +1,20 @@ +export const projects = [ + { text: '超级剪贴板', link: '/project/ClipboardManager/' }, + { text: '超级Markdown', link: '/project/Markdown/' }, + { text: '超级JavaScript', link: '/project/JSRunner/' }, + { text: '超级分词', link: '/project/SmartWordBreak/' } +] + +export const works = [ + { text: '个人作品', link: '/works/opensource' }, + { text: '社区贡献', link: '/works/contribution' } +] + +export const notes = [ + { text: 'JavaScript基础', link: '/note/JavaScript' }, + { text: 'CSS基础', link: '/note/CSS' }, + { text: 'JavaScript进阶', link: '/note/JavaScriptEnhanced' }, + { text: '前端工程化', link: '/note/Front-end Engineering' }, + { text: '服务端渲染', link: '/note/SSR' }, + { text: 'React基础', link: '/note/React' } +]