|
38 | 38 | <div class="layout"> |
39 | 39 | <aside class="sidebar"> |
40 | 40 | <div class="sidebar-section"> |
41 | | - <div class="sidebar-title">Workshop Steps</div> |
| 41 | + <div class="sidebar-title" id="sidebarTitle">Workshop Steps</div> |
42 | 42 | <nav id="stepNav"></nav> |
43 | 43 | </div> |
44 | 44 | </aside> |
|
54 | 54 | </div> |
55 | 55 |
|
56 | 56 | <script> |
57 | | - const steps = [ |
| 57 | + const ideSteps = [ |
58 | 58 | { id: '00-overview', file: 'workshop/00-overview.md', title: 'Workshop Overview', number: '📚' }, |
59 | 59 | { id: '01-prerequisites', file: 'workshop/01-prerequisites.md', title: 'Prerequisites & Setup', number: '01' }, |
60 | 60 | { id: '02-assess', file: 'workshop/02-assess.md', title: 'Assess Your Application', number: '02' }, |
|
64 | 64 | { id: 'prompts', file: 'PROMPTS.md', title: 'Copilot Prompts Guide', number: '📖' }, |
65 | 65 | ]; |
66 | 66 |
|
| 67 | + const cliSteps = [ |
| 68 | + { id: '00-overview', file: 'workshop-cli/00-overview.md', title: 'Workshop Overview', number: '📚' }, |
| 69 | + { id: '01-prerequisites', file: 'workshop-cli/01-prerequisites.md', title: 'Prerequisites & Setup', number: '01' }, |
| 70 | + { id: '02-assess', file: 'workshop-cli/02-assess.md', title: 'Start Copilot CLI', number: '02' }, |
| 71 | + { id: '03-upgrade', file: 'workshop-cli/03-upgrade.md', title: 'Upgrade Runtime & Frameworks', number: '03' }, |
| 72 | + { id: '04-health-endpoints', file: 'workshop-cli/04-health-endpoints.md', title: 'Health Endpoints', number: '04' }, |
| 73 | + { id: '05-containerize', file: 'workshop-cli/05-containerize.md', title: 'Containerize Applications', number: '05' }, |
| 74 | + ]; |
| 75 | + |
| 76 | + function getVariant() { |
| 77 | + const params = new URLSearchParams(window.location.search); |
| 78 | + return params.get('variant') === 'cli' ? 'cli' : 'ide'; |
| 79 | + } |
| 80 | + |
| 81 | + const variant = getVariant(); |
| 82 | + const steps = variant === 'cli' ? cliSteps : ideSteps; |
| 83 | + const variantParam = variant === 'cli' ? 'variant=cli&' : ''; |
| 84 | + |
67 | 85 | const isLocal = window.location.hostname === 'localhost' || window.location.hostname === '127.0.0.1' || window.location.protocol === 'file:'; |
68 | 86 | const GITHUB_RAW_BASE = isLocal ? '../' : 'https://raw.githubusercontent.com/copilot-dev-days/appmod-workshop-java/main/'; |
69 | 87 |
|
|
76 | 94 |
|
77 | 95 | function buildSidebar() { |
78 | 96 | const nav = document.getElementById('stepNav'); |
| 97 | + document.getElementById('sidebarTitle').textContent = variant === 'cli' ? 'CLI Workshop Steps' : 'Workshop Steps'; |
79 | 98 | nav.innerHTML = steps.map((step, i) => ` |
80 | | - <a href="?step=${step.id}" class="step-link ${i === currentIndex ? 'active' : ''}" data-index="${i}"> |
| 99 | + <a href="?${variantParam}step=${step.id}" class="step-link ${i === currentIndex ? 'active' : ''}" data-index="${i}"> |
81 | 100 | <span class="step-number">${step.number}</span> |
82 | 101 | <span>${step.title}</span> |
83 | 102 | </a> |
|
94 | 113 | const prev = currentIndex > 0 ? steps[currentIndex - 1] : null; |
95 | 114 | const next = currentIndex < steps.length - 1 ? steps[currentIndex + 1] : null; |
96 | 115 | footer.innerHTML = ` |
97 | | - <a href="${prev ? '?step=' + prev.id : '#'}" class="nav-footer-btn ${!prev ? 'disabled' : ''}">← ${prev ? prev.title : 'Previous'}</a> |
98 | | - <a href="${next ? '?step=' + next.id : '#'}" class="nav-footer-btn ${!next ? 'disabled' : ''}">${next ? next.title : 'Next'} →</a> |
| 116 | + <a href="${prev ? '?' + variantParam + 'step=' + prev.id : '#'}" class="nav-footer-btn ${!prev ? 'disabled' : ''}">← ${prev ? prev.title : 'Previous'}</a> |
| 117 | + <a href="${next ? '?' + variantParam + 'step=' + next.id : '#'}" class="nav-footer-btn ${!next ? 'disabled' : ''}">${next ? next.title : 'Next'} →</a> |
99 | 118 | `; |
100 | 119 | } |
101 | 120 |
|
102 | 121 | function navigate(direction) { |
103 | 122 | const newIndex = currentIndex + direction; |
104 | 123 | if (newIndex >= 0 && newIndex < steps.length) { |
105 | | - window.location.href = `?step=${steps[newIndex].id}`; |
| 124 | + window.location.href = `?${variantParam}step=${steps[newIndex].id}`; |
106 | 125 | } |
107 | 126 | } |
108 | 127 |
|
|
0 commit comments