Fix missing env variable

This commit is contained in:
Yarmo Mackenbach 2020-08-31 07:25:06 +02:00
parent 0b1674753c
commit 7deb66c8e0

View file

@ -68,11 +68,12 @@ router.get('/guides', (req, res) => {
}); });
router.get('/guides/:guideId', (req, res) => { router.get('/guides/:guideId', (req, res) => {
let env = {};
let rawContent = fs.readFileSync(`./content/guides/${req.params.guideId}.md`, "utf8", (err, data) => { let rawContent = fs.readFileSync(`./content/guides/${req.params.guideId}.md`, "utf8", (err, data) => {
if (err) throw err; if (err) throw err;
return data; return data;
}); });
const content = md.render(rawContent); const content = md.render(rawContent, env);
res.render(`basic`, { title: `${env.title} - Keyoxide`, content: content }); res.render(`basic`, { title: `${env.title} - Keyoxide`, content: content });
}); });