Extract inline CSS/JS, add EJS templates with shared layout

- Extract CSS into public/css/{shared,players,courses}.css
- Extract JS into public/js/{chart,tooltips,progress,players,courses}.js
- Consolidate 5 duplicated tooltip blocks into setupTooltip() helper
- Add EJS view engine with layout partial and nav partial
- Convert HTML pages to EJS templates (index.ejs, courses.ejs)
- Add /courses route with redirect from /courses.html
- Remove old monolithic HTML files (1478 + 612 lines)
This commit is contained in:
Samuel Enocsson
2026-02-18 22:32:03 +01:00
parent 33a962e6b8
commit 20bbdbbfcf
18 changed files with 2010 additions and 2094 deletions
+7 -3
View File
@@ -1,13 +1,17 @@
const express = require('express');
const path = require('path');
const router = express.Router();
router.get('/', (req, res) => {
res.sendFile(path.join(__dirname, '../../index.html'));
res.render('index');
});
router.get('/courses', (req, res) => {
res.render('courses');
});
// Keep old URL working
router.get('/courses.html', (req, res) => {
res.sendFile(path.join(__dirname, '../../courses.html'));
res.redirect('/courses');
});
module.exports = router;