diff --git a/.gitignore b/.gitignore index 03f2af24..7f548e85 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,3 @@ node_modules -.temp \ No newline at end of file +dist +cache \ No newline at end of file diff --git a/README.md b/README.md index fc5574d6..e2034607 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -# 基于Vuepress的个人主页 +# 基于VitePress的个人主页 `Github Page` + `Gitee Page` + `Vercel` @@ -6,7 +6,7 @@ # 安装依赖 pnpm i # 热更新 -pnpm run docs:dev +pnpm run dev # 构建 -pnpm run docs:build +pnpm run build ``` \ No newline at end of file diff --git a/docs/.vitepress/config.ts b/docs/.vitepress/config.ts new file mode 100644 index 00000000..02bafc7b --- /dev/null +++ b/docs/.vitepress/config.ts @@ -0,0 +1,80 @@ +import { defineConfig } from 'vitepress' + +export default defineConfig({ + title: 'ZiuChen', + description: 'Unlimited Progress.', + ignoreDeadLinks: true, + lastUpdated: true, + markdown: { + lineNumbers: true + }, + themeConfig: { + logo: '/logo.png', + nav: [ + { text: '首页', link: '/' }, + { + text: '我的项目', + items: [ + { text: '超级剪贴板', link: '/project/ClipboardManager/' }, + { text: '超级分词', link: '/project/SmartWordBreak/' } + ] + }, + { + text: '开源作品', + items: [ + { text: '个人作品', link: '/works/opensource' }, + { text: '社区贡献', link: '/works/contribution' } + ] + }, + { + text: '学习笔记', + items: [ + { text: 'JavaScript基础', link: '/note/JavaScript' }, + { text: 'CSS基础', link: '/note/CSS' }, + { text: 'JavaScript进阶', link: '/note/JavaScriptEnhanced' } + ] + }, + { + text: '个人介绍', + link: '/self/' + } + ], + sidebar: [ + { + text: '我的项目', + collapsible: true, + items: [ + { text: '超级剪贴板', link: '/project/ClipboardManager/' }, + { text: '超级分词', link: '/project/SmartWordBreak/' } + ] + }, + { + text: '开源作品', + collapsible: true, + items: [ + { text: '个人作品', link: '/works/opensource' }, + { text: '社区贡献', link: '/works/contribution' } + ] + }, + { + text: '学习笔记', + collapsible: true, + items: [ + { text: 'JavaScript基础', link: '/note/JavaScript' }, + { text: 'CSS基础', link: '/note/CSS' }, + { text: 'JavaScript进阶', link: '/note/JavaScriptEnhanced' } + ] + } + ], + socialLinks: [{ icon: 'github', link: 'https://ziuchen.github.io/' }], + editLink: { + pattern: 'https://github.com/ZiuChen/ZiuChen.github.io/edit/main/docs/:path', + text: 'Edit this page on GitHub' + }, + footer: { + message: 'Released under the MIT License.', + copyright: 'Copyright © 2019-present Ziu Chen' + }, + lastUpdatedText: 'Updated Date' + } +}) diff --git a/docs/.vuepress/config.js b/docs/.vuepress/config.js deleted file mode 100644 index c5c4bd98..00000000 --- a/docs/.vuepress/config.js +++ /dev/null @@ -1,74 +0,0 @@ -module.exports = { - title: 'ZiuChen', - description: 'Unlimited Progress.', - head: [ - ['link', { rel: 'icon', href: '/logo.png' }], - [ - 'script', - {}, - /* js */ ` - var _hmt = _hmt || []; - (function() { - var isDev = document.location.href.indexOf("localhost") !== -1 - var isGitee = document.location.href.indexOf("gitee.io") !== -1 - var hm1 = document.createElement("script"); - hm1.src = "https://hm.baidu.com/hm.js?08b4ef50a9244e83e5a1bd5822442829"; // gitee - var hm2 = document.createElement("script"); - hm2.src = "https://hm.baidu.com/hm.js?50bac15a1f238d1aa61f104a5fb6f5e0"; // github - var s = document.getElementsByTagName("script")[0]; - if(isDev) return // 不上报 - if (isGitee) s.parentNode.insertBefore(hm1, s); - else s.parentNode.insertBefore(hm2, s); - })(); - - ` - ] - ], - plugins: [ - '@vuepress/medium-zoom', - '@vuepress/active-header-links', - '@vuepress/plugin-back-to-top', - '@vuepress/last-updated', - { - transformer: (timestamp) => { - const d = new Date(timestamp) - return d.toLocaleDateString() + d.toLocaleTimeString() - } - } - ], - themeConfig: { - nav: [ - { text: '首页', link: '/' }, - { - text: '开源作品', - link: '/works/' - }, - { - text: '个人介绍', - link: '/self/', - items: [ - { - text: '技术栈', - link: '/self/#技术栈' - }, - { - text: '获得奖项', - link: '/self/#获得奖项' - }, - { - text: '相关链接', - link: '/self/#相关链接' - } - ] - } - ], - displayAllHeaders: true, - logo: '/logo.png', - repo: 'ZiuChen/ZiuChen.github.io', - editLinks: true, - docsBranch: 'main', - docsDir: 'docs', - lastUpdated: 'Last Updated', - search: false - } -} diff --git a/docs/.vuepress/enhanceApp.js b/docs/.vuepress/enhanceApp.js deleted file mode 100644 index 083b9e88..00000000 --- a/docs/.vuepress/enhanceApp.js +++ /dev/null @@ -1,10 +0,0 @@ -export default ({ router }) => { - router.beforeEach((to, from, next) => { - if (typeof _hmt !== 'undefined') { - if (to.path) { - _hmt.push(['_trackPageview', to.fullPath]) // 添加埋点上报 - } - } - next() // 执行路由跳转 - }) -} diff --git a/docs/.vuepress/styles/index.styl b/docs/.vuepress/styles/index.styl deleted file mode 100644 index d88ed7c2..00000000 --- a/docs/.vuepress/styles/index.styl +++ /dev/null @@ -1,5 +0,0 @@ -.theme-container.home-page-class { - .page-edit { - display: none; - } -} \ No newline at end of file diff --git a/docs/README.md b/docs/README.md deleted file mode 100644 index ca8a0641..00000000 --- a/docs/README.md +++ /dev/null @@ -1,13 +0,0 @@ ---- -pageClass: home-page-class ---- - -
- -

ZiuChen

- Infinite Progress -

- 💖 开源作品 | Works - 😉 个人介绍 | About -

-
diff --git a/docs/index.md b/docs/index.md new file mode 100644 index 00000000..ce664238 --- /dev/null +++ b/docs/index.md @@ -0,0 +1,25 @@ +--- +layout: home +title: 主页 +hero: + name: ZiuChen + text: 无限进步. + tagline: Infinite Progress... + actions: + - theme: brand + text: Get Started + link: /self/ + - theme: alt + text: View on GitHub + link: https://github.com/ZiuChen +features: + - icon: 🎓 + title: Electronic Information Major + details: 电子信息工程 + - icon: 🎯 + title: JavaScript & TypeScript + details: 自学前端 热爱技术 + - icon: 👆 + title: See more information + details: 访问导航栏查看更多信息 +--- \ No newline at end of file diff --git a/docs/note/CSS.md b/docs/note/CSS.md index e043e04b..2245d393 100644 --- a/docs/note/CSS.md +++ b/docs/note/CSS.md @@ -1,6 +1,4 @@ --- -sidebar: auto -sidebarDepth: 2 editLink: false --- diff --git a/docs/note/JavaScript.md b/docs/note/JavaScript.md index 7ec3a3ed..1d80c4ba 100644 --- a/docs/note/JavaScript.md +++ b/docs/note/JavaScript.md @@ -1,6 +1,4 @@ --- -sidebar: auto -sidebarDepth: 2 editLink: false --- diff --git a/docs/note/JavaScriptEnhanced.md b/docs/note/JavaScriptEnhanced.md index e15820d6..a8fcaccc 100644 --- a/docs/note/JavaScriptEnhanced.md +++ b/docs/note/JavaScriptEnhanced.md @@ -1,6 +1,4 @@ --- -sidebar: auto -sidebarDepth: 2 editLink: false --- @@ -1455,9 +1453,9 @@ inherit(Student, Person) - 遇到`