Skip to content

Commit 7c48bd7

Browse files
committed
废弃dumi 使用 vitepress
1 parent 27eb44f commit 7c48bd7

File tree

20 files changed

+1229
-14198
lines changed

20 files changed

+1229
-14198
lines changed

.dumirc.ts

Lines changed: 0 additions & 12 deletions
This file was deleted.

.editorconfig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ root = true
33

44
[*]
55
indent_style = space
6-
indent_size = 2
6+
indent_size = 4
77
end_of_line = lf
88
charset = utf-8
99
trim_trailing_whitespace = true

.github/workflows/deploy.yml

Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
name: Deploy VitePress site to Pages
2+
3+
on:
4+
push:
5+
branches: [main]
6+
7+
workflow_dispatch:
8+
9+
permissions:
10+
contents: read
11+
pages: write
12+
id-token: write
13+
14+
concurrency:
15+
group: pages
16+
cancel-in-progress: false
17+
18+
jobs:
19+
build:
20+
runs-on: ubuntu-latest
21+
steps:
22+
- name: Checkout
23+
uses: actions/checkout@v4
24+
with:
25+
fetch-depth: 0
26+
27+
- uses: pnpm/action-setup@v3
28+
with:
29+
version: 9
30+
31+
- name: Setup Node
32+
uses: actions/setup-node@v4
33+
with:
34+
node-version: 22
35+
cache: pnpm
36+
37+
- name: Setup Pages
38+
uses: actions/configure-pages@v4
39+
40+
- name: Install dependencies
41+
run: pnpm install
42+
43+
- name: Build with VitePress
44+
run: pnpm docs:build
45+
46+
- name: Upload artifact
47+
uses: actions/upload-pages-artifact@v3
48+
with:
49+
path: docs/.vitepress/dist
50+
51+
deploy:
52+
environment:
53+
name: github-pages
54+
url: ${{ steps.deployment.outputs.page_url }}
55+
needs: build
56+
runs-on: ubuntu-latest
57+
name: Deploy
58+
steps:
59+
- name: Deploy to GitHub Pages
60+
id: deployment
61+
uses: actions/deploy-pages@v4

.github/workflows/gh-pages.yml

Lines changed: 0 additions & 59 deletions
This file was deleted.

.gitignore

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
node_modules
22
/dist
3-
.dumi/tmp
4-
.dumi/tmp-production
3+
/docs/.vitepress/cache
4+
/docs/.vitepress/dist
55
.DS_Store

.prettierignore

Lines changed: 0 additions & 3 deletions
This file was deleted.

.prettierrc.js

Lines changed: 0 additions & 14 deletions
This file was deleted.

README.md

Lines changed: 0 additions & 21 deletions
This file was deleted.

docs/.vitepress/config.mts

Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
import { DefaultTheme, defineConfig } from 'vitepress'
2+
3+
export default defineConfig({
4+
title: "consistent的文档",
5+
description: "一些文档",
6+
themeConfig: {
7+
nav: [
8+
{ text: '简介', link: '/guide/start' },
9+
{ text: '环境配置', link: '/environment/homebrew' }
10+
],
11+
12+
sidebar: {
13+
'/guide/': { base: '/guide/', items: sidebarGuide() },
14+
'/environment/': { base: '/environment/', items: sidebarEnvironment() }
15+
},
16+
17+
socialLinks: [
18+
{ icon: 'github', link: 'https://github.com/vuejs/vitepress' }
19+
],
20+
21+
22+
docFooter: {
23+
prev: '上一页',
24+
next: '下一页'
25+
},
26+
27+
outline: {
28+
label: '页面导航'
29+
},
30+
31+
lastUpdated: {
32+
text: '最后更新于',
33+
formatOptions: {
34+
dateStyle: 'short',
35+
timeStyle: 'medium'
36+
}
37+
},
38+
39+
returnToTopLabel: '回到顶部',
40+
41+
}
42+
})
43+
44+
function sidebarGuide(): DefaultTheme.SidebarItem[] {
45+
return [
46+
{
47+
text: '简介',
48+
link: 'start'
49+
}
50+
]
51+
}
52+
53+
function sidebarEnvironment(): DefaultTheme.SidebarItem[] {
54+
return [
55+
{
56+
text: '环境配置',
57+
items: [
58+
{ text: 'Homebrew', link: 'homebrew' },
59+
{ text: 'Git', link: 'git' },
60+
{ text: 'Iterm2', link: 'iterm2' },
61+
{ text: 'Node.js', link: 'nodejs' }
62+
]
63+
}
64+
]
65+
}
File renamed without changes.

0 commit comments

Comments
 (0)