Reify taxonomies into just tags. I'm probably not going to need anything else, and this makes it a lot clearer
1 file changed, 7 insertions(+), 9 deletions(-)
changed files
M src/actions.js → src/actions.js
@@ -50,17 +50,15 @@ responder(ctx, config, { post }); }; } -function taxonGenerator(config, responder, term, items) { +function tag(config, responder, items) { return async function(ctx, next) { - const value = ctx.params.value; - ctx.assert(items.has(ctx.params.value), 404, `${term} ${value} not found`); - - const taxonItems = items.get(value); + const tag = ctx.params.name; + ctx.assert(items.has(tag), 404, `tag ${tag} not found`); responder(ctx, config, { - listType: term, - listName: value, - posts: taxonItems + listType: "tag", + listName: tag, + posts: items.get(tag) }); }; }@@ -79,6 +77,6 @@ home, posts, highlightTheme, post, - taxonGenerator, + tag, serveFiles };