Skip to content

Commit 28269e3

Browse files
committed
feat: autofill base
1 parent 4e97b9f commit 28269e3

File tree

3 files changed

+13
-2
lines changed

3 files changed

+13
-2
lines changed

.github/workflows/build.yml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,17 @@ jobs:
1414
- name: Checkout Branch
1515
uses: actions/checkout@v2
1616

17+
- name: Set Base Url
18+
run: |
19+
BRANCH=$(echo ${GITHUB_REF} | sed -e 's/refs\/heads\///')
20+
BEFORE=base: ''
21+
if [[ $BRANCH == ver/* ]]; then
22+
AFTER=$(echo $BRANCH | sed 's|^ver/||')
23+
else
24+
AFTER=base: ''
25+
fi
26+
sed -i "s/${BEFORE}/${AFTER}/g" "./docs/.vitepress/config.mts"
27+
1728
- name: Setup Node.js
1829
uses: actions/setup-node@v2
1930
with:

.github/workflows/deploy.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ on:
66
types: [completed]
77

88
jobs:
9-
on-success:
9+
Deploy:
1010
runs-on: ubuntu-latest
1111
if: ${{ github.event.workflow_run.conclusion == 'success' }}
1212

docs/.vitepress/config.mts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ const vitepressOptions: UserConfig = {
2727
description: "Docs of CommandAPI",
2828
cleanUrls: true,
2929
metaChunk: true,
30-
base: '', // place to put the version
30+
base: '', // do not change this line
3131
ignoreDeadLinks: true, // TODO remove when all things are done
3232
rewrites: {
3333
'en/:rest*': ':rest*'

0 commit comments

Comments
 (0)