feat: Add posts listing
1 file changed, 9 insertions(+), 1 deletion(-)
changed files
M src/actions.js → src/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,