Skip to content

Commit b09a70d

Browse files
Fix: Copy lab folder to docs during deployment
- Update deploy workflow to copy lab/ into docs/lab/ - Fix markdown and image paths in step.html - Trigger on lab/** changes too
1 parent 64c93f1 commit b09a70d

File tree

2 files changed

+8
-4
lines changed

2 files changed

+8
-4
lines changed

.github/workflows/deploy-pages.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ on:
77
branches: ["main"]
88
paths:
99
- 'docs/**'
10+
- 'lab/**'
1011

1112
# Allows you to run this workflow manually from the Actions tab
1213
workflow_dispatch:
@@ -32,6 +33,9 @@ jobs:
3233
- name: Checkout
3334
uses: actions/checkout@v4
3435

36+
- name: Copy lab files to docs
37+
run: cp -r lab docs/
38+
3539
- name: Setup Pages
3640
uses: actions/configure-pages@v5
3741

docs/step.html

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -608,8 +608,8 @@
608608
// Process markdown - fix image paths and handle special syntax
609609
function processMarkdown(md) {
610610
// Fix image paths - images are in lab/images/
611-
md = md.replace(/!\[([^\]]*)\]\(\.\/images\//g, '![$1](../lab/images/');
612-
md = md.replace(/!\[([^\]]*)\]\(images\//g, '![$1](../lab/images/');
611+
md = md.replace(/!\[([^\]]*)\]\(\.\/images\//g, '![$1](lab/images/');
612+
md = md.replace(/!\[([^\]]*)\]\(images\//g, '![$1](lab/images/');
613613

614614
// Convert GitHub-style checkboxes: 1. [] becomes checkbox
615615
md = md.replace(/^(\d+)\.\s*\[\s*\]\s*/gm, '$1. <input type="checkbox"> ');
@@ -639,8 +639,8 @@
639639
document.title = `${step.title} | VS GitHub Copilot Lab`;
640640

641641
try {
642-
// Fetch markdown from lab folder
643-
const response = await fetch(`../lab/${step.file}`);
642+
// Fetch markdown from lab folder (copied to docs/lab during deploy)
643+
const response = await fetch(`lab/${step.file}`);
644644
if (!response.ok) throw new Error('Failed to load');
645645

646646
let md = await response.text();

0 commit comments

Comments
 (0)