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:
+7
-3
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user