Skip to content
This repository was archived by the owner on Aug 25, 2025. It is now read-only.

Commit c430037

Browse files
authored
fix: Allow basePath to follow contributor repo name (#54)
* fix:githubpage构建时BasePath路径动态获取 * fix:githubpage构建时BasePath路径动态获取 * feat: 补充`DEPLOY_PLATFORM`环境变量
1 parent 4e86ce0 commit c430037

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

.github/workflows/deploy-ghpage.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,9 @@ on:
88
pull_request:
99
paths:
1010
- '.github/workflows/deploy-ghpage.yml'
11-
11+
env:
12+
REPO_NAME: ${{ github.event.repository.name }}
13+
DEPLOY_PLATFORM: "github"
1214
jobs:
1315
deploy-gh-pages:
1416
runs-on: ubuntu-latest

docs/.vuepress/config.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,8 @@ const __dirname = getDirname(import.meta.url);
88
const getBasePath = () => {
99
const platform = process.env.DEPLOY_PLATFORM;
1010
if (platform === 'github') {
11-
return '/docs/';
11+
const repo_name = process.env.REPO_NAME || 'docs';
12+
return `/${repo_name}/`;
1213
}
1314
return '/';
1415
};

0 commit comments

Comments
 (0)