Fix non-updating guide titles

This commit is contained in:
Yarmo Mackenbach 2020-08-18 09:51:11 +02:00
parent 6eb57bf521
commit 6bbf712809

View file

@ -30,7 +30,6 @@ more information on this, and how to apply and follow the GNU AGPL, see <https:/
const router = require('express').Router(); const router = require('express').Router();
const md = require('markdown-it')({typographer: true}); const md = require('markdown-it')({typographer: true});
const fs = require('fs'); const fs = require('fs');
const env = {};
md.use(require("markdown-it-anchor")); md.use(require("markdown-it-anchor"));
md.use(require("markdown-it-table-of-contents"), { "includeLevel": [2, 3], "listType": "ol" }); md.use(require("markdown-it-table-of-contents"), { "includeLevel": [2, 3], "listType": "ol" });
@ -57,6 +56,8 @@ router.get('/guides', (req, res) => {
}); });
router.get('/guides/:guideId', (req, res) => { router.get('/guides/:guideId', (req, res) => {
const env = {};
let data = fs.readFileSync(`./guides/${req.params.guideId}.md`, "utf8", (err, data) => { let data = fs.readFileSync(`./guides/${req.params.guideId}.md`, "utf8", (err, data) => {
if (err) throw err; if (err) throw err;
return data; return data;