diff options
author | Alan Pearce | 2017-06-30 20:35:51 +0200 |
---|---|---|
committer | Alan Pearce | 2017-06-30 20:35:51 +0200 |
commit | 4df9074e0fc8db381d94fb4680a5d7dee3d096de (patch) | |
tree | f9daf4c657553dfcbe6be09331a8f62cb68118e7 | |
parent | 5eb982dc5b8c4853931bdfa3b216c35720dd8b98 (diff) | |
download | homestead-4df9074e0fc8db381d94fb4680a5d7dee3d096de.tar.lz homestead-4df9074e0fc8db381d94fb4680a5d7dee3d096de.tar.zst homestead-4df9074e0fc8db381d94fb4680a5d7dee3d096de.zip |
fix: add page title to header
-rw-r--r-- | src/responders.js | 5 | ||||
-rw-r--r-- | test/app.test.js | 1 |
2 files changed, 5 insertions, 1 deletions
diff --git a/src/responders.js b/src/responders.js index 0bd841f..acfcaf1 100644 --- a/src/responders.js +++ b/src/responders.js @@ -42,7 +42,10 @@ const templates = { function setTitle(siteTitle, pageTitle) { return rheo.template(function(s) { return s - .inner("title", rheo((pageTitle ? " · " : "") + siteTitle)) + .inner( + "title", + rheo(pageTitle ? `${pageTitle} · ${siteTitle}` : siteTitle) + ) .inner("body header h1", rheo(siteTitle)); }); } diff --git a/test/app.test.js b/test/app.test.js index 4c90881..b2f91d1 100644 --- a/test/app.test.js +++ b/test/app.test.js @@ -34,6 +34,7 @@ test("post", t => { .expect(/^<!DOCTYPE html>/) .then(parseResponse) .then($ => { + t.is($("head > title").text(), "This is a test · " + config.site.title); t.is($("article h1").text(), "This is a test"); t.is( $("article p").text(), |