Skip to content

Commit 0a0444c

Browse files
committed
doc: update document config
1 parent e053a8c commit 0a0444c

File tree

2 files changed

+17
-2
lines changed

2 files changed

+17
-2
lines changed

.github/workflows/document-deploy.yml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,3 +32,14 @@ jobs:
3232
BUILD_SCRIPT: cd document && yarn && yarn docs:build
3333
BUILD_DIR: docs/.vuepress/dist/
3434
CNAME: cosid.ahoo.me
35+
36+
- name: Build and Deploy With Site Base
37+
uses: jenkey2011/vuepress-deploy@master
38+
env:
39+
SITE_BASE: /cosid/
40+
ACCESS_TOKEN: ${{ secrets.ACCESS_TOKEN }}
41+
TARGET_REPO: Ahoo-Wang/CosId
42+
TARGET_BRANCH: gh-pages-with-site-base
43+
BUILD_SCRIPT: cd document && yarn && yarn docs:build
44+
BUILD_DIR: docs/.vuepress/dist/
45+
CNAME: cosid.ahoo.me

document/docs/.vuepress/config.ts

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,13 @@ import {
1515
NavItemsZH, SidebarZH
1616
} from './config/index'
1717

18+
const siteBase: `/${string}/` = process.env.SITE_BASE || "/"
19+
20+
console.log('Configured SiteBase is:' + siteBase)
21+
1822
const GM_ID = 'G-SP6EEGK56L'
1923

2024
export default defineConfig(ctx => ({
21-
base: '',
2225
head: [
2326
['link', {rel: 'icon', href: `/favicon.ico`}],
2427
[
@@ -84,5 +87,6 @@ export default defineConfig(ctx => ({
8487
['vuepress-plugin-flowchart']
8588
],
8689
extraWatchFiles: ['.vuepress/config/**'],
87-
evergreen: !ctx.isProd
90+
evergreen: !ctx.isProd,
91+
base: siteBase
8892
}));

0 commit comments

Comments
 (0)