diff options
author | Alan Pearce | 2017-10-03 15:30:54 +0200 |
---|---|---|
committer | Alan Pearce | 2017-10-03 15:30:54 +0200 |
commit | ad56116d0df26b4a6fe7f9cd04a21965d3184af5 (patch) | |
tree | b8fcb4944e9e0d60cbe11b2226b9acd42713b7f7 /src/actions.js | |
parent | 84da95bc4a8374bd3962e2479df560c67a1b94ca (diff) | |
download | homestead-ad56116d0df26b4a6fe7f9cd04a21965d3184af5.tar.lz homestead-ad56116d0df26b4a6fe7f9cd04a21965d3184af5.tar.zst homestead-ad56116d0df26b4a6fe7f9cd04a21965d3184af5.zip |
Reify taxonomies into just tags.
I'm probably not going to need anything else, and this makes it a lot clearer
Diffstat (limited to 'src/actions.js')
-rw-r--r-- | src/actions.js | 16 |
1 files changed, 7 insertions, 9 deletions
diff --git a/src/actions.js b/src/actions.js index 2ad0c77..61f4fd8 100644 --- a/src/actions.js +++ b/src/actions.js @@ -50,17 +50,15 @@ function post(config, responder, posts) { }; } -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 @@ module.exports = { posts, highlightTheme, post, - taxonGenerator, + tag, serveFiles }; |