Skip to content

Commit e082ec5

Browse files
committed
修復 project page 部署的 baseurl 問題
- 更新 workflow 自動檢測 project page 並設置正確的 baseurl - 添加 _config.test.yml 測試環境配置
1 parent 7c6392b commit e082ec5

File tree

2 files changed

+19
-1
lines changed

2 files changed

+19
-1
lines changed

.github/workflows/run.yml

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,17 @@ jobs:
5252
bundle install --jobs 4 --retry 3
5353
5454
- name: Build Jekyll site
55-
run: bundle exec jekyll build
55+
run: |
56+
# Check if this is a project page (repo name != owner.github.io)
57+
REPO_NAME="${GITHUB_REPOSITORY#*/}"
58+
OWNER="${GITHUB_REPOSITORY_OWNER}"
59+
if [[ "$REPO_NAME" != "${OWNER}.github.io" ]]; then
60+
echo "Building for project page: baseurl=/${REPO_NAME}"
61+
bundle exec jekyll build --baseurl "/${REPO_NAME}"
62+
else
63+
echo "Building for user/org page: no baseurl"
64+
bundle exec jekyll build
65+
fi
5666
env:
5767
JEKYLL_ENV: production
5868

_config.test.yml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
# =============================================
2+
# Test Environment Configuration Override
3+
# For deployment to: awesome-doge.github.io/cypherpunks-core.github.io
4+
# =============================================
5+
6+
# Override baseurl for project page deployment
7+
baseurl: "/cypherpunks-core.github.io"
8+
url: "https://awesome-doge.github.io"

0 commit comments

Comments
 (0)