summary refs log tree commit diff stats
path: root/src/responders.js
diff options
context:
space:
mode:
authorAlan Pearce2017-07-04 21:03:24 +0200
committerAlan Pearce2017-07-04 21:03:24 +0200
commit9d601e206bdad2c384f2328a14fea8c0f5428ca9 (patch)
treef83086a1139ea84393ebe30436f30205f9750024 /src/responders.js
parente7b08b1dfe3f2a2596deb6e2a72bb79805d3708f (diff)
downloadhomestead-9d601e206bdad2c384f2328a14fea8c0f5428ca9.tar.lz
homestead-9d601e206bdad2c384f2328a14fea8c0f5428ca9.tar.zst
homestead-9d601e206bdad2c384f2328a14fea8c0f5428ca9.zip
feat: Add posts listing
Diffstat (limited to 'src/responders.js')
-rw-r--r--src/responders.js18
1 files changed, 9 insertions, 9 deletions
diff --git a/src/responders.js b/src/responders.js
index 48d1949..75850f8 100644
--- a/src/responders.js
+++ b/src/responders.js
@@ -37,7 +37,7 @@ const templates = {
   layout: templateReader("layout"),
   home: templateReader("home", baseIndentLevel),
   post: templateReader("post", baseIndentLevel),
-  taxon: templateReader("taxon", baseIndentLevel)
+  list: templateReader("list", baseIndentLevel)
 };
 
 function title(siteTitle, pageTitle) {
@@ -97,25 +97,25 @@ module.exports = {
     );
   },
 
-  post(ctx, config, post) {
+  list(ctx, config, listType, listName, posts) {
     ctx.type = "html";
 
     ctx.body = layout(
       config,
-      post.data.get("title"),
-      hyperfast(templates.post, renderPost(ctx)(post))
+      Case.title(listName),
+      hyperfast(templates.list, {
+        ".h-entry": posts.map(renderPost(ctx))
+      })
     );
   },
 
-  taxon(ctx, config, term, value, taxonItems) {
+  post(ctx, config, post) {
     ctx.type = "html";
 
     ctx.body = layout(
       config,
-      Case.title(value),
-      hyperfast(templates.taxon, {
-        ".h-entry": taxonItems.map(renderPost(ctx))
-      })
+      post.data.get("title"),
+      hyperfast(templates.post, renderPost(ctx)(post))
     );
   }
 };