From cff6bcc31d59ce9957567cc05c1ed7e364fb40ca Mon Sep 17 00:00:00 2001
From: Alan Pearce
Date: Wed, 5 Jul 2017 22:15:03 +0200
Subject: Add rel=me links
---
config/default.toml | 8 +++++
src/responders.js | 9 ++++-
src/templates/layout.html | 7 ++++
test/app.test.js | 13 ++++---
test/snapshots/app.test.js.md | 76 ++++++++++++++++++++++++++++++++++++----
test/snapshots/app.test.js.snap | Bin 1658 -> 1880 bytes
6 files changed, 102 insertions(+), 11 deletions(-)
diff --git a/config/default.toml b/config/default.toml
index 0a55027..d2efd7a 100644
--- a/config/default.toml
+++ b/config/default.toml
@@ -11,6 +11,14 @@ url = "/"
name = "John Doe"
photo = "/static/johndoe.jpg"
+[[author.contact]]
+url = "mailto:johndoe@johndoe.org"
+text = "johndoe@johndoe.org"
+
+[[author.contact]]
+url = "https://twitter.com/johndoe"
+text = "Twitter"
+
[posts]
folder = "./posts"
diff --git a/src/responders.js b/src/responders.js
index f29b2b0..eeec42a 100644
--- a/src/responders.js
+++ b/src/responders.js
@@ -76,7 +76,14 @@ function layout(config, pageTitle, pageElement) {
_text: l.text
}
})),
- "body > main": pageElement.outerHTML
+ "body > main": pageElement.outerHTML,
+ ".contact-list li": config.author.contact.map(c => ({
+ a: {
+ class: c.url.startsWith("mailto") ? "u-email" : "u-url",
+ href: c.url,
+ _text: c.text
+ }
+ }))
}).outerHTML.trim();
}
diff --git a/src/templates/layout.html b/src/templates/layout.html
index 86eec59..6035209 100644
--- a/src/templates/layout.html
+++ b/src/templates/layout.html
@@ -18,5 +18,12 @@
+