File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ name : Deploy VitePress site to GitHub Pages
2+
3+ on :
4+ push :
5+ branches : [main]
6+ workflow_dispatch :
7+
8+ permissions :
9+ contents : read
10+ pages : write
11+ id-token : write
12+
13+ concurrency :
14+ group : pages
15+ cancel-in-progress : false
16+
17+ jobs :
18+ build :
19+ runs-on : ubuntu-latest
20+ steps :
21+ - name : Checkout
22+ uses : actions/checkout@v4
23+ with :
24+ fetch-depth : 0
25+
26+ - name : Setup pnpm
27+ uses : pnpm/action-setup@v4
28+
29+ - name : Setup Node.js
30+ uses : actions/setup-node@v4
31+ with :
32+ node-version : 20
33+ cache : pnpm
34+
35+ - name : Install dependencies
36+ run : pnpm install --frozen-lockfile
37+
38+ - name : Build with VitePress
39+ run : pnpm build
40+
41+ - name : Setup Pages
42+ uses : actions/configure-pages@v5
43+
44+ - name : Upload artifact
45+ uses : actions/upload-pages-artifact@v3
46+ with :
47+ path : .vitepress/dist
48+
49+ deploy :
50+ needs : build
51+ runs-on : ubuntu-latest
52+ environment :
53+ name : github-pages
54+ url : ${{ steps.deployment.outputs.page_url }}
55+ steps :
56+ - name : Deploy to GitHub Pages
57+ id : deployment
58+ uses : actions/deploy-pages@v4
Original file line number Diff line number Diff line change 11import { defineConfig } from "vitepress" ;
22
3+ const base = "/Mp2RSS/" ;
34const GOOGLE_ANALYTICS_ID = process . env . GOOGLE_ANALYTICS_ID || "" ;
45const gaHead = GOOGLE_ANALYTICS_ID
56 ? ( [
@@ -28,11 +29,11 @@ export default defineConfig({
2829 srcDir : "docs" ,
2930 title : "Mp2RSS" ,
3031 description : "让订阅微信公众号像订阅播客一样顺畅" ,
31- base : "/" ,
32+ base,
3233 lastUpdated : true ,
3334 head : [
34- [ "link" , { rel : "icon" , href : "/ favicon.ico" } ] ,
35- [ "link" , { rel : "apple-touch-icon" , href : "/ apple-touch-icon.png" } ] ,
35+ [ "link" , { rel : "icon" , href : ` ${ base } favicon.ico` } ] ,
36+ [ "link" , { rel : "apple-touch-icon" , href : ` ${ base } apple-touch-icon.png` } ] ,
3637 ...gaHead ,
3738 ] ,
3839 themeConfig : {
You can’t perform that action at this time.
0 commit comments