Skip to content

Commit 860602c

Browse files
Merge pull request #3 from Awesome-Embedded-Learning-Studio/feat/migrate_to_vitepress
feat: migrate to vitepress
2 parents de4a0c6 + 77af319 commit 860602c

39 files changed

Lines changed: 4116 additions & 616 deletions

File tree

.github/workflows/deploy.yml

Lines changed: 24 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -1,51 +1,42 @@
1-
# 工作流名称
2-
name: 自动部署 MkDocs
1+
name: Deploy VitePress
32

4-
# 触发条件:推送到 main 分支
53
on:
64
push:
75
branches:
86
- main
9-
10-
# 允许手动触发
117
workflow_dispatch:
128

13-
# 设置权限
149
permissions:
15-
contents: write # 允许推送到 gh-pages 分支
10+
contents: write
1611

1712
jobs:
1813
deploy:
1914
runs-on: ubuntu-latest
20-
15+
2116
steps:
22-
# 1. 检出代码
23-
- name: 检出仓库
17+
- name: Checkout
2418
uses: actions/checkout@v4
2519
with:
26-
fetch-depth: 0 # 获取完整历史,显示文章修改时间
27-
28-
# 2. 设置 Python
29-
- name: 设置 Python
30-
uses: actions/setup-python@v5
20+
fetch-depth: 0
21+
22+
- name: Setup Node.js
23+
uses: actions/setup-node@v4
24+
with:
25+
node-version: 22
26+
27+
- name: Setup pnpm
28+
uses: pnpm/action-setup@v4
3129
with:
32-
python-version: "3.11"
33-
# cache: 'pip' # 缓存依赖,加速构建
34-
35-
# 3. 安装依赖
36-
- name: 安装依赖
37-
run: |
38-
pip install mkdocs-material
39-
pip install mkdocs-awesome-pages-plugin
40-
pip install mkdocs-git-revision-date-localized-plugin
41-
42-
# 4. 构建网站
43-
- name: 构建网站
44-
run: mkdocs build --clean
45-
46-
# 5. 自动部署到 gh-pages 分支(这一步会自动触发 GitHub Pages)
47-
- name: 部署到 GitHub Pages
30+
version: 10
31+
32+
- name: Install dependencies
33+
run: pnpm install
34+
35+
- name: Build
36+
run: pnpm build
37+
38+
- name: Deploy to GitHub Pages
4839
uses: peaceiris/actions-gh-pages@v4
4940
with:
50-
github_token: ${{ secrets.GITHUB_TOKEN }} # GitHub 自动提供的 token
51-
publish_dir: ./site # MkDocs 构建输出目录
41+
github_token: ${{ secrets.GITHUB_TOKEN }}
42+
publish_dir: ./site/.vitepress/dist

.gitignore

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,4 +10,11 @@ build/
1010

1111
# IDE / tooling cache
1212
.cache/
13-
**/.cache/
13+
**/.cache/
14+
15+
# VitePress
16+
node_modules/
17+
site/.vitepress/dist/
18+
site/.vitepress/cache/
19+
site/.vitepress/.build-cache/
20+
site/.vitepress/.build-tmp/

mkdocs.yml

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

package.json

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
{
2+
"name": "awesomeqt-vitepress",
3+
"version": "0.0.1",
4+
"private": true,
5+
"type": "module",
6+
"scripts": {
7+
"dev": "vitepress dev site",
8+
"build": "NODE_OPTIONS='--disable-warning=DEP0205' pnpm exec tsx scripts/build.ts",
9+
"build:single": "vitepress build site",
10+
"preview": "vitepress preview site"
11+
},
12+
"devDependencies": {
13+
"@types/node": "^25.6.2",
14+
"tsx": "^4.21.0",
15+
"vitepress": "^1.6.4",
16+
"vue": "^3.5.34"
17+
},
18+
"pnpm": {
19+
"onlyBuiltDependencies": [
20+
"esbuild"
21+
]
22+
},
23+
"dependencies": {
24+
"minisearch": "^7.2.0"
25+
}
26+
}

0 commit comments

Comments
 (0)