diff options
| -rw-r--r-- | haunt/jakob/theme.scm | 2 | ||||
| -rw-r--r-- | haunt/static/image/lobsters.png | bin | 0 -> 4535 bytes | |||
| -rw-r--r-- | haunt/static/js/webmention.js | 33 |
3 files changed, 18 insertions, 17 deletions
diff --git a/haunt/jakob/theme.scm b/haunt/jakob/theme.scm index d31d510..eff37e9 100644 --- a/haunt/jakob/theme.scm +++ b/haunt/jakob/theme.scm @@ -30,7 +30,7 @@ ("me" "https://mastodon.sdf.org/@jakob") ("webmention" "https://webmention.io/jakob.space/webmention") ("pingback" "https://webmention.io/jakob.space/xmlrpc") - ("pgpkey authn" "/gpg.txt"))) + ("pgpkey authn" "/static/gpg.txt"))) (define %nav-bar-tabs '(("About" "/pages/about.html") ;; ("Projects" "/pages/projects.html") ("Tags" "/tag.html") diff --git a/haunt/static/image/lobsters.png b/haunt/static/image/lobsters.png Binary files differnew file mode 100644 index 0000000..e75cc99 --- /dev/null +++ b/haunt/static/image/lobsters.png diff --git a/haunt/static/js/webmention.js b/haunt/static/js/webmention.js index d1bb8e8..1c18c6d 100644 --- a/haunt/static/js/webmention.js +++ b/haunt/static/js/webmention.js @@ -18,20 +18,17 @@ */ function buildApiUri() { - const snip = /https?:\/\/.*?\//.exec(window.location.href); - const page = window.location.href.substring(snip[0].length); - - // TODO: Build up from aliases, etc. - const aliases = [page]; - - return Array.concat( - ["https://webmention.io/api/mentions.jf2?"], - aliases.flatMap((alias) => { - const ref = "jakob.space"; - return [ - `target[]=http://${ref}/${alias}`, - `target[]=https://${ref}/${alias}` - ]; + const ref = "jakob.space"; + const slug = /[^\/]*(?=\.html)/.exec(window.location.href); + const endpoints = [ + `http://${ref}/${slug}.html`, + `https://${ref}/${slug}.html`, + `http://${ref}/blog/${slug}.html`, + `https://${ref}/blog/${slug}.html`, + ]; + return ["https://webmention.io/api/mentions.jf2?"].concat( + endpoints.map((endpoint) => { + return `target[]=${endpoint}`; }).join("&") ).join(""); } @@ -75,7 +72,9 @@ function makeComment(comment) { // Create the h-card section. let avatar = element("img", { "class": "u-photo", - "src": comment.author.photo + "src": comment.url.startsWith("https://lobste.rs/") + ? "/static/image/lobsters.png" + : comment.author.photo }); let authorName = element("a", { @@ -101,7 +100,9 @@ function makeComment(comment) { let contentContainer = element("div", { "class": "e-content p-name comment-content", }); - contentContainer.textContent = comment.content.text; + contentContainer.textContent = comment.hasOwnProperty("content") + ? comment.content.text + : "[No Text Provided]"; // Create the metaline section. let time = element("time", { |