all repos — archive/homestead @ 9d601e206bdad2c384f2328a14fea8c0f5428ca9

My future indieweb platform

feat: Add posts listing

Alan Pearce
commit

9d601e206bdad2c384f2328a14fea8c0f5428ca9

parent

e7b08b1dfe3f2a2596deb6e2a72bb79805d3708f

1 file changed, 9 insertions(+), 1 deletion(-)

changed files
M src/actions.jssrc/actions.js
@@ -12,6 +12,13 @@ responders.home(ctx, config, postsArray);
}; } +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 @@ ctx.assert(items.has(ctx.params.value), 404, `${term} ${value} not found`);
const taxonItems = items.get(value); - responders.taxon(ctx, config, term, value, taxonItems); + responders.list(ctx, config, term, value, taxonItems); }; }
@@ -62,6 +69,7 @@ }
module.exports = { home, + posts, highlightTheme, post, taxonGenerator,