Skip to content

Commit 732386a

Browse files
feat: initial commit of the new project structure
0 parents  commit 732386a

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

45 files changed

+5832
-0
lines changed

.github/workflows/deploy-docs.yml

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
2+
name: 部署文档
3+
4+
on:
5+
push:
6+
branches:
7+
- main
8+
9+
permissions:
10+
contents: write
11+
12+
jobs:
13+
deploy-gh-pages:
14+
runs-on: ubuntu-latest
15+
steps:
16+
- name: Checkout
17+
uses: actions/checkout@v4
18+
with:
19+
fetch-depth: 0
20+
# 如果你文档需要 Git 子模块,取消注释下一行
21+
# submodules: true
22+
23+
- name: 设置 pnpm
24+
uses: pnpm/action-setup@v4
25+
26+
27+
- name: 设置 Node.js
28+
uses: actions/setup-node@v4
29+
with:
30+
node-version: 22
31+
cache: pnpm
32+
33+
- name: 安装依赖
34+
run: |
35+
corepack enable
36+
pnpm install --frozen-lockfile
37+
38+
- name: 构建文档
39+
env:
40+
NODE_OPTIONS: --max_old_space_size=8192
41+
run: |-
42+
pnpm run docs:build
43+
> src/.vuepress/dist/.nojekyll
44+
45+
- name: 部署文档
46+
uses: JamesIves/github-pages-deploy-action@v4
47+
with:
48+
# 部署文档
49+
branch: gh-pages
50+
folder: src/.vuepress/dist

.gitignore

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
2+
node_modules/
3+
src/.vuepress/.cache/
4+
src/.vuepress/.temp/
5+
src/.vuepress/dist/

deploy.sh

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
#!/usr/bin/env sh
2+
3+
# 确保脚本抛出遇到的错误
4+
set -e
5+
6+
# 生成静态文件
7+
pnpm docs:build
8+
9+
# 进入生成的文件夹
10+
cd src/.vuepress/dist
11+
12+
# 如果是发布到自定义域名
13+
# echo 'www.example.com' > CNAME
14+
15+
git init
16+
git add -A
17+
18+
git commit -m "deploy"
19+
# 如果发布到 https://<USERNAME>.github.io
20+
git push -f [email protected]:<USERNAME>/<USERNAME>.github.io.git master
21+
22+
# 如果发布到 https://<USERNAME>.github.io/<REPO>
23+
# git push -f [email protected]:<USERNAME>/<REPO>.git master:gh-pages
24+
25+
cd -

package.json

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
{
2+
"name": "blog",
3+
"description": "记录学习",
4+
"version": "2.0.0",
5+
"license": "MIT",
6+
"type": "module",
7+
"scripts": {
8+
"docs:build": "vuepress-vite build src",
9+
"docs:clean-dev": "vuepress-vite dev src --clean-cache",
10+
"docs:dev": "vuepress-vite dev src",
11+
"docs:update-package": "pnpm dlx vp-update"
12+
},
13+
"devDependencies": {
14+
"@iconify-json/uil": "^1.2.3",
15+
"@vuepress/bundler-vite": "2.0.0-rc.24",
16+
"sass-embedded": "^1.89.2",
17+
"vue": "^3.5.17",
18+
"vuepress": "2.0.0-rc.24",
19+
"vuepress-theme-hope": "2.0.0-rc.94"
20+
},
21+
"pnpm": {
22+
"onlyBuiltDependencies": [
23+
"esbuild"
24+
]
25+
}
26+
}

0 commit comments

Comments
 (0)