summary refs log tree commit diff stats
path: root/src/index.js
diff options
context:
space:
mode:
authorAlan Pearce2017-06-18 17:42:21 +0200
committerAlan Pearce2017-06-18 17:42:21 +0200
commit33171a749162685e42650f82041cd2af0136718d (patch)
treebd6970a89c47db7ea13698ca378eae0df605af0d /src/index.js
parent1a36d4dc311a86246fe854da888af01f8195368e (diff)
downloadhomestead-33171a749162685e42650f82041cd2af0136718d.tar.lz
homestead-33171a749162685e42650f82041cd2af0136718d.tar.zst
homestead-33171a749162685e42650f82041cd2af0136718d.zip
feat(posts): render posts as markdown
Diffstat (limited to 'src/index.js')
-rw-r--r--src/index.js4
1 files changed, 3 insertions, 1 deletions
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
   })
 })