all repos — archive/homestead @ ad56116d0df26b4a6fe7f9cd04a21965d3184af5

My future indieweb platform

Reify taxonomies into just tags. I'm probably not going to need anything else, and this makes it a lot clearer

Alan Pearce
commit

ad56116d0df26b4a6fe7f9cd04a21965d3184af5

parent

84da95bc4a8374bd3962e2479df560c67a1b94ca

1 file changed, 7 insertions(+), 9 deletions(-)

changed files
M src/actions.jssrc/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 };