mirror of
https://github.com/ZiuChen/ZiuChen.github.io.git
synced 2025-12-21 02:05:39 +08:00
docs: 文档更新
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
import { defineConfig } from 'vitepress'
|
||||
import generateSideBar from './scripts/generateSideBar'
|
||||
|
||||
export default defineConfig({
|
||||
title: 'ZiuChen',
|
||||
@@ -35,6 +36,10 @@ export default defineConfig({
|
||||
{ text: 'JavaScript进阶', link: '/note/JavaScriptEnhanced' }
|
||||
]
|
||||
},
|
||||
{
|
||||
text: '文章创作',
|
||||
link: '/article/一文读懂伪类与伪元素'
|
||||
},
|
||||
{
|
||||
text: '个人介绍',
|
||||
link: '/self/'
|
||||
@@ -57,6 +62,11 @@ export default defineConfig({
|
||||
{ text: '社区贡献', link: '/works/contribution' }
|
||||
]
|
||||
},
|
||||
{
|
||||
text: '文章创作',
|
||||
collapsible: true,
|
||||
items: [...generateSideBar()]
|
||||
},
|
||||
{
|
||||
text: '学习笔记',
|
||||
collapsible: true,
|
||||
@@ -67,7 +77,15 @@ export default defineConfig({
|
||||
]
|
||||
}
|
||||
],
|
||||
socialLinks: [{ icon: 'github', link: 'https://ziuchen.github.io/' }],
|
||||
socialLinks: [
|
||||
{ icon: 'github', link: 'https://ziuchen.github.io/' },
|
||||
{
|
||||
icon: {
|
||||
svg: '<svg width="36" height="28" viewBox="0 0 36 28" fill="none" xmlns="http://www.w3.org/2000/svg"><path fill-rule="evenodd" clip-rule="evenodd" d="M17.5875 6.77268L21.8232 3.40505L17.5875 0.00748237L17.5837 0L13.3555 3.39757L17.5837 6.76894L17.5875 6.77268ZM17.5863 17.3955H17.59L28.5161 8.77432L25.5526 6.39453L17.59 12.6808H17.5863L17.5825 12.6845L9.61993 6.40201L6.66016 8.78181L17.5825 17.3992L17.5863 17.3955ZM17.5828 23.2891L17.5865 23.2854L32.2133 11.7456L35.1768 14.1254L28.5238 19.3752L17.5865 28L0.284376 14.3574L0 14.1291L2.95977 11.7531L17.5828 23.2891Z" fill="#1E80FF"/></svg>'
|
||||
},
|
||||
link: 'https://juejin.cn/user/1887205216238477'
|
||||
}
|
||||
],
|
||||
editLink: {
|
||||
pattern: 'https://github.com/ZiuChen/ZiuChen.github.io/edit/main/docs/:path',
|
||||
text: 'Edit this page on GitHub'
|
||||
|
||||
17
docs/.vitepress/scripts/generateSideBar.ts
Normal file
17
docs/.vitepress/scripts/generateSideBar.ts
Normal file
@@ -0,0 +1,17 @@
|
||||
import fs from 'fs'
|
||||
import path from 'path'
|
||||
|
||||
export default function generateSideBar() {
|
||||
const articles = fs.readdirSync(path.resolve(__dirname, '../../article'))
|
||||
|
||||
const sidebar = articles.map((article) => {
|
||||
// 移除后缀 `.md`
|
||||
const title = article.replace(/\.md$/, '')
|
||||
return {
|
||||
text: title,
|
||||
link: `/article/${title}`
|
||||
}
|
||||
})
|
||||
|
||||
return sidebar
|
||||
}
|
||||
@@ -8,6 +8,11 @@
|
||||
z-index: 21;
|
||||
}
|
||||
|
||||
/* SideBar scrollbar */
|
||||
.VPSidebar::-webkit-scrollbar {
|
||||
display: none;
|
||||
}
|
||||
|
||||
/* Color Variables */
|
||||
|
||||
:root {
|
||||
|
||||
Reference in New Issue
Block a user