From 33171a749162685e42650f82041cd2af0136718d Mon Sep 17 00:00:00 2001 From: Alan Pearce Date: Sun, 18 Jun 2017 17:42:21 +0200 Subject: feat(posts): render posts as markdown --- src/index.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'src/index.js') diff --git a/src/index.js b/src/index.js index 07d7249..fce4c09 100644 --- a/src/index.js +++ b/src/index.js @@ -24,8 +24,10 @@ router.get('/', async function (ctx) { router.get('/post/:filename', async function (ctx) { ctx.assert(posts.has(ctx.params.filename), 404, 'Post not found') + const post = posts.get(ctx.params.filename) + post.body = Posts.render(post) await ctx.render('post', { - post: posts.get(ctx.params.filename) + post: post }) }) -- cgit 1.4.1