diff options
author | Alan Pearce | 2017-06-25 13:03:41 +0200 |
---|---|---|
committer | Alan Pearce | 2017-06-25 13:03:41 +0200 |
commit | a7960192e2a268c02643a9374adb4d8798c15d5a (patch) | |
tree | 14944f52d9f7d2686a4a61d35747ad1b6e798215 /src/responders.js | |
parent | 6061d1e5b5bdd67ab958c7cedc2f3fe5712e3ea2 (diff) | |
download | homestead-a7960192e2a268c02643a9374adb4d8798c15d5a.tar.lz homestead-a7960192e2a268c02643a9374adb4d8798c15d5a.tar.zst homestead-a7960192e2a268c02643a9374adb4d8798c15d5a.zip |
refactor: move markdown rendering to domain
The input and output formats (md -> html) are specific to the domain of blogging, not really a presentation concern. This also means that markdown is rendered to HTML on startup, rather than per-request
Diffstat (limited to 'src/responders.js')
-rw-r--r-- | src/responders.js | 3 |
1 files changed, 1 insertions, 2 deletions
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() }, |