Skip to content
Snippets Groups Projects
Commit 61cb8656 authored by Alexandre Roulois's avatar Alexandre Roulois
Browse files

Remove extension html from route

parent 9b633c19
No related branches found
No related tags found
2 merge requests!29Main,!28Remove extension html from route
......@@ -6,8 +6,9 @@ const i18next = require('i18next');
/* GET page. */
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';
/* if '.html' in filename, delete it */
const page = req.params.page ? req.params.page.replace('.html', '') : 'home';
const title = req.params.page ? req.params.page.toUpperCase() : 'HOME'
res.render(`${req.language}/${page}`, {
title: req.t(`TITLES.${title}`)
......
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