diff options
-rw-r--r-- | src/domain/posts.js | 3 | ||||
-rw-r--r-- | src/responders.js | 3 |
2 files changed, 4 insertions, 2 deletions
diff --git a/src/domain/posts.js b/src/domain/posts.js index 14bc7cc..aedf58e 100644 --- a/src/domain/posts.js +++ b/src/domain/posts.js @@ -3,6 +3,7 @@ const fs = require('fs') const path = require('path') const matter = require('gray-matter') +const markdown = require('../modules/markdown.js') const grayMatterOptions = { lang: 'toml', @@ -31,6 +32,8 @@ function getTitle (file) { function get (filename) { const fileMatter = matter.read(filename, grayMatterOptions) fileMatter.basename = getTitle(fileMatter) + delete fileMatter.orig + fileMatter.body = markdown(fileMatter.content) return canonicaliseMetadata(fileMatter) } diff --git a/src/responders.js b/src/responders.js index b6354a5..0cc6da8 100644 --- a/src/responders.js +++ b/src/responders.js @@ -2,7 +2,6 @@ const fs = require('fs') const rheo = require('rheo') -const markdown = require('./modules/markdown.js') const templateReader = template => () => fs.createReadStream(`${__dirname}/templates/${template}.html`) @@ -56,7 +55,7 @@ module.exports = { .pipe(rheo()) .inner('main', showPage('post')) .inner('article h1', rheo(post.data.get('title'))) - .inner('article main', rheo(markdown(post.content))) + .inner('article main', rheo(post.body)) .pipe(setTitle(config.site.title, post.data.get('title'))) .render() }, |