summary refs log tree commit diff stats
path: root/src/actions.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/actions.js
parente7b08b1dfe3f2a2596deb6e2a72bb79805d3708f (diff)
downloadhomestead-9d601e206bdad2c384f2328a14fea8c0f5428ca9.tar.lz
homestead-9d601e206bdad2c384f2328a14fea8c0f5428ca9.tar.zst
homestead-9d601e206bdad2c384f2328a14fea8c0f5428ca9.zip
feat: Add posts listing
Diffstat (limited to 'src/actions.js')
-rw-r--r--src/actions.js10
1 files changed, 9 insertions, 1 deletions
diff --git a/src/actions.js b/src/actions.js
index 7c7482f..e6d7f98 100644
--- a/src/actions.js
+++ b/src/actions.js
@@ -12,6 +12,13 @@ function home(config, posts) {
   };
 }
 
+function posts(config, posts) {
+  const postsArray = Array.from(posts.values());
+  return async function(ctx, next) {
+    responders.list(ctx, config, null, "Posts", postsArray);
+  };
+}
+
 function highlightTheme(config) {
   const theme = config.posts.code.theme;
   const themeFile = path.resolve(
@@ -47,7 +54,7 @@ function taxonGenerator(config, term, items) {
 
     const taxonItems = items.get(value);
 
-    responders.taxon(ctx, config, term, value, taxonItems);
+    responders.list(ctx, config, term, value, taxonItems);
   };
 }
 
@@ -62,6 +69,7 @@ async function serveFiles(ctx) {
 
 module.exports = {
   home,
+  posts,
   highlightTheme,
   post,
   taxonGenerator,