Skip to content

Commit

Permalink
use theme
Browse files Browse the repository at this point in the history
  • Loading branch information
hojas committed Aug 8, 2024
1 parent 068a321 commit f4df089
Show file tree
Hide file tree
Showing 6 changed files with 826 additions and 164 deletions.
25 changes: 20 additions & 5 deletions .vitepress/config.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,30 @@
import { getThemeConfig } from '@sugarat/theme/node'

import { head } from './head'
import { nav } from './nav'
import { sidebar } from './sidebar'

const blogTheme = getThemeConfig({
comment: {
repo: 'hojas/frontend-guide',
repoId: 'R_kgDOHItlnw',
category: 'Announcements',
categoryId: 'DIC_kwDOHItln84CblVj',
inputPosition: 'bottom',
},
footer: {
message: '',
version: false,
copyright: 'MIT License | 前端指北',
},
})

export default {
extends: blogTheme,
base: '/',
lang: 'zh-Hans',
title: 'FrontendGuide',
description: 'FrontendGuide 是一个分享前端开发技术和 Node.js 开发技术的编程网站。',
title: '前端指北',
description: '前端指北是一个分享前端开发技术和 Node.js 开发技术的编程网站。',
srcDir: 'src/docs',
markdown: { lineNumbers: true, math: true, mermaid: true },
lastUpdated: true,
Expand All @@ -21,8 +39,5 @@ export default {
prev: '上一篇',
next: '下一篇',
},
footer: {
copyright: 'Copyright © 2024-present FrontendGuide',
},
},
}
18 changes: 11 additions & 7 deletions .vitepress/theme/index.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,12 @@
import type { Theme } from 'vitepress'
import DefaultTheme from 'vitepress/theme'
import MyLayout from './MyLayout.vue'
// import type { Theme } from 'vitepress'
// import DefaultTheme from 'vitepress/theme'
// import MyLayout from './MyLayout.vue'
//
// export default {
// extends: DefaultTheme,
// Layout: MyLayout,
// } satisfies Theme

export default {
extends: DefaultTheme,
Layout: MyLayout,
} satisfies Theme
import BlogTheme from '@sugarat/theme'

export default BlogTheme
13 changes: 9 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "frontend-guide",
"type": "module",
"packageManager": "pnpm@9.6.0",
"packageManager": "pnpm@9.7.0",
"author": "hojas",
"license": "MIT",
"scripts": {
Expand All @@ -10,16 +10,21 @@
"serve": "vitepress serve --host 0.0.0.0 --port 3000"
},
"dependencies": {
"@element-plus/icons-vue": "^2.3.1",
"@giscus/vue": "^3.0.0",
"@sugarat/theme": "^0.4.9",
"element-plus": "^2.7.8",
"markdown-it-mathjax3": "^4.3.2",
"vue": "^3.4.35",
"pagefind": "^1.1.0",
"vue": "^3.4.36",
"vue-mermaid-render": "^0.1.4"
},
"devDependencies": {
"@antfu/eslint-config": "^2.24.1",
"@types/node": "^22.0.2",
"@types/node": "^22.1.0",
"eslint": "^9.8.0",
"sass": "^1.77.8",
"typescript": "^5.5.4",
"vitepress": "^1.3.1"
"vitepress": "^1.3.2"
}
}
Loading

0 comments on commit f4df089

Please sign in to comment.