Skip to content

Commit 0c01d90

Browse files
committed
try fix paths for gh pages
1 parent d976b16 commit 0c01d90

3 files changed

Lines changed: 17 additions & 6 deletions

File tree

app/src/decks.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ export default [
1212
date: "2026-01-14",
1313
url: dev
1414
? "http://localhost:3033"
15-
: "/2026-01-14_cwl-handsOn/"
15+
: repo + "/2026-01-14_cwl-handsOn/"
1616
},
1717
{
1818
id: "2025-12-12_wfls",
@@ -22,7 +22,7 @@ export default [
2222
date: "2025-12-12",
2323
url: dev
2424
? "http://localhost:3032"
25-
: "/2025-12-12_wfls/"
25+
: repo + "/2025-12-12_wfls/"
2626
},
2727
{
2828
id: "2025-12-04_arc",
@@ -32,7 +32,7 @@ export default [
3232
date: "2025-12-04",
3333
url: dev
3434
? "http://localhost:3031"
35-
: "/2025-12-04_arc/"
35+
: repo + "/2025-12-04_arc/"
3636
},
3737
{
3838
id: "2025-11-19_intro-rdm",
@@ -42,6 +42,6 @@ export default [
4242
date: "2025-11-19",
4343
url: dev
4444
? "http://localhost:3030"
45-
: "/2025-11-19_intro-rdm/"
45+
: repo + "/2025-11-19_intro-rdm/"
4646
}
4747
]

scripts/build-all.js

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,11 @@ import { spawnSync } from 'child_process'
55
const ROOT = process.cwd()
66
const DECKS_DIR = path.join(ROOT, 'slide-decks')
77

8+
const repo = process.env.GITHUB_REPOSITORY
9+
? '/' + process.env.GITHUB_REPOSITORY.split('/')[1]
10+
: ''
11+
12+
813
const isDeck = name =>
914
fs.existsSync(path.join(DECKS_DIR, name, 'slides.md'))
1015

@@ -17,7 +22,7 @@ for (const deck of decks) {
1722
console.log(`Building ${deck}`)
1823
spawnSync(
1924
'npx',
20-
['slidev', 'build', '--base', `/${deck}/`],
25+
['slidev', 'build', '--base', `${repo}/${deck}/`],
2126
{
2227
cwd: path.join(DECKS_DIR, deck),
2328
stdio: 'inherit',

scripts/generate-decks.js

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,11 @@ const OUTPUT = path.join(ROOT, 'app/src/decks.js')
77

88
const BASE_PORT = 3030
99

10+
const repo = process.env.GITHUB_REPOSITORY
11+
? '/' + process.env.GITHUB_REPOSITORY.split('/')[1]
12+
: ''
13+
14+
1015
// ----------------- Helpers -----------------
1116

1217
function parseFrontmatter(md) {
@@ -84,12 +89,13 @@ ${withPorts
8489
date: "${d.date}",
8590
url: dev
8691
? "http://localhost:${d.port}"
87-
: "/${d.id}/"
92+
: repo + "/${d.id}/"
8893
}`
8994
)
9095
.join(',\n')}
9196
]
9297
`
9398

99+
94100
fs.writeFileSync(OUTPUT, output)
95101
console.log(`Generated ${withPorts.length} decks (stable ports, sorted by date)`)

0 commit comments

Comments
 (0)