Skip to content
Snippets Groups Projects
Commit 15c54c9f authored by ROULOIS Alexandre's avatar ROULOIS Alexandre :bicyclist:
Browse files

Merge branch 'develop' into 'main'

Develop

See merge request !24
parents 6be2354d 98cc0c1d
No related branches found
No related tags found
2 merge requests!25Main,!24Develop
......@@ -30,8 +30,11 @@ var indexRouter = require('./routes/index');
var app = express();
// serve additional libraries
app.use("/stylesheets", express.static(path.join(__dirname, "node_modules/bootstrap/dist/css")))
app.use("/javascripts", express.static(path.join(__dirname, "node_modules/bootstrap/dist/js")))
app.use("/stylesheets", express.static(path.join(__dirname, "node_modules/bootstrap-icons/font")) )
app.use(["/javascripts", "/stylesheets"], express.static(path.join(__dirname, "node_modules/leaflet/dist")) )
app.use("/javascripts", express.static(path.join(__dirname, "node_modules/jquery/dist")))
// view engine setup
app.set('views', path.join(__dirname, 'views'));
......@@ -48,8 +51,9 @@ app.use(express.static(path.join(__dirname, 'public')));
app.use('/', indexRouter);
// catch 404 and forward to error handler
app.use(function(req, res, next) {
next(createError(404));
app.use((req, res, next) => {
res.status(404);
res.render('404', { title: '404' });
});
// error handler
......
{
"ERRORS": {
"404": {
"LOST": "Lost?",
"MESSAGE": "Think about the needle of a compass. Finding one’s way, wouldn't it be to know what one is attracted to? And then, perhaps, deviate."
}
},
"GLOBAL": {
"FOOTER": {
"CREDITS": "Powered by"
......
{
"ERRORS": {
"404": {
"LOST": "Égaré·e ?",
"MESSAGE": "Savoir s’orienter, ne serait-ce pas avant tout, comme l’aiguille de la boussole, décider par quoi on est attiré·e ? Et puis, peut-être, dévier."
}
},
"GLOBAL": {
"FOOTER": {
"CREDITS": "Propulsé par"
......
......@@ -7,6 +7,7 @@
"test": "mocha"
},
"dependencies": {
"bootstrap": "^5.2.3",
"bootstrap-icons": "^1.10.4",
"cookie-parser": "~1.4.3",
"debug": "~2.6.9",
......@@ -15,6 +16,7 @@
"i18next": "^21.6.6",
"i18next-fs-backend": "^1.1.4",
"i18next-http-middleware": "^3.1.5",
"jquery": "^3.6.4",
"leaflet": "^1.9.3",
"moment": "^2.29.1",
"morgan": "~1.9.0",
......
This diff is collapsed.
source diff could not be displayed: it is too large. Options to address this: view the blob.
This diff is collapsed.
source diff could not be displayed: it is too large. Options to address this: view the blob.
This diff is collapsed.
......@@ -4,14 +4,19 @@ var router = express.Router();
const i18next = require('i18next');
/* GET page. */
router.get('/:page?', function(req, res, next) {
router.get('/:page?', (req, res, next) => {
const page = req.params.page ? req.params.page : 'home';
const title = req.params.page ? req.params.page.toUpperCase() : 'HOME';
res.render(`${req.language}/${page}`, {
title: req.t(`TITLES.${title}`)
});
}, (err, html) => {
if (err) {
res.status(404);
res.render('404', { title: '404' });
} else res.send(html);
})
});
......
extends layout
block content
div.row.mt-3.pt-2.bg-caramel-alpha
div.col.d-flex.pb-4(style="height:400px")
div.m-auto.text-center
h1.display-1.text-terracotta
| #[i.bi-compass] #{t("ERRORS.404.LOST")}
p.lead
| #{t("ERRORS.404.MESSAGE")}
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment