Skip to content

Commit f36c853

Browse files
committed
bump 0.2.11
1 parent 4c95f94 commit f36c853

2 files changed

Lines changed: 8 additions & 5 deletions

File tree

index.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
<meta charset="UTF-8" />
55
<link rel="icon" type="image/png" href="./favicon.ico" />
66
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
7-
<title>NSS Data Structures and Algorithms Course</title>
7+
<title>%COURSE_NAME%</title>
88
<!-- Handle SPA routing for GitHub Pages -->
99
<script type="text/javascript">
1010
// Check if we have a redirect route stored from 404.html

vite.config.js

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,10 @@ export default defineConfig(({ mode }) => {
1818

1919
// Read config.js to get courseName and doAuth
2020
let courseName = 'Data Structures and Algorithms'; // fallback
21-
let courseUrl = 'data-structures-and-algorithms'; // fallback
21+
22+
let baseUrl = env.BASE_URL ? env.BASE_URL : 'data-structures-and-algorithms';
23+
console.log("baseUrl: ",baseUrl);
24+
2225
let doAuth = false; // fallback
2326
try {
2427
const configPath = path.resolve(process.cwd(), 'src/config.js');
@@ -28,7 +31,7 @@ export default defineConfig(({ mode }) => {
2831
if (courseNameMatch) {
2932
courseName = courseNameMatch[1];
3033
// Transform courseName to URL-friendly format
31-
courseUrl = courseName.toLowerCase().replace(/\s+/g, '-').replace(/[^a-z0-9-]/g, '');
34+
3235
}
3336

3437
const doAuthMatch = configContent.match(/doAuth:\s*(true|false)/);
@@ -49,7 +52,7 @@ export default defineConfig(({ mode }) => {
4952
transformIndexHtml(html) {
5053
return html
5154
.replace(/%COURSE_NAME%/g, courseName)
52-
.replace(/%COURSE_URL%/g, courseUrl);
55+
.replace(/%COURSE_URL%/g, baseUrl);
5356
}
5457
};
5558

@@ -88,7 +91,7 @@ export default defineConfig(({ mode }) => {
8891
}
8992

9093
return {
91-
base: `/${courseUrl}/`,
94+
base: `/${baseUrl}/`,
9295
plugins,
9396
// Make env variables available to client-side code
9497
...(doAuth && {

0 commit comments

Comments
 (0)