-
-
- - Test post please ignore - -
From ab3c5ffb57980359a186936aa6fc2894f58eb625 Mon Sep 17 00:00:00 2001
From: Alan Pearce
Date: Sat, 1 Jul 2017 13:30:57 +0200
Subject: feat(taxon): Show taxonomy term in title
---
package.json | 1 +
src/actions.js | 2 +-
src/responders.js | 5 +++--
src/templates/taxon.html | 12 +++++-------
test/app.test.js | 8 ++++++--
yarn.lock | 4 ++++
6 files changed, 20 insertions(+), 12 deletions(-)
diff --git a/package.json b/package.json
index db17e2f..6cb7921 100644
--- a/package.json
+++ b/package.json
@@ -44,6 +44,7 @@
"supertest": "^3.0.0"
},
"dependencies": {
+ "case": "^1.5.2",
"configly": "^4.1.0",
"gray-matter": "^2.1.1",
"hyperfast": "^2.1.0",
diff --git a/src/actions.js b/src/actions.js
index 11acff5..8a04671 100644
--- a/src/actions.js
+++ b/src/actions.js
@@ -26,7 +26,7 @@ function taxonGenerator(config, term, items) {
const taxonItems = items.get(value);
- responders.taxon(ctx, config, taxonItems);
+ responders.taxon(ctx, config, term, value, taxonItems);
};
}
diff --git a/src/responders.js b/src/responders.js
index b9758f3..e285018 100644
--- a/src/responders.js
+++ b/src/responders.js
@@ -1,6 +1,7 @@
"use strict";
const fs = require("fs");
+const Case = require("case");
const hyperfast = require("hyperfast");
const indent = require("indent-string");
@@ -86,12 +87,12 @@ module.exports = {
);
},
- taxon(ctx, config, taxonItems) {
+ taxon(ctx, config, term, value, taxonItems) {
ctx.type = "html";
ctx.body = layout(
config,
- null,
+ Case.title(value),
hyperfast(templates.taxon, {
".post": taxonItems.map(renderPostListItem(ctx))
})
diff --git a/src/templates/taxon.html b/src/templates/taxon.html
index 44e1bdc..97ac89a 100644
--- a/src/templates/taxon.html
+++ b/src/templates/taxon.html
@@ -1,7 +1,5 @@
-
-
-