From e7cb1f03a5ebeb5818bb0f5d877f0e5f12f8bd65 Mon Sep 17 00:00:00 2001 From: Rohan Kumar Date: Sat, 4 Jun 2022 16:43:31 -0700 Subject: [PATCH] Put webmentions in a
elememnt. --- layouts/partials/webmentions.html | 107 +++++++++++++++--------------- 1 file changed, 55 insertions(+), 52 deletions(-) diff --git a/layouts/partials/webmentions.html b/layouts/partials/webmentions.html index e1da4e5..706d103 100644 --- a/layouts/partials/webmentions.html +++ b/layouts/partials/webmentions.html @@ -2,58 +2,61 @@

Webmen­tions

This site supports Webmentions. Webmentions received for this post will appear in the following list after I approve them. I sometimes send Webmentions to myself on behalf of linking sites that don't support them. Check the Wayback Machine if any links are broken.

{{ partial "webmention-form.html" . }} -
- {{- $target := .RelPermalink | replaceRE "^/~seirdy/" "/" }} - {{- $oldTarget := $target | replaceRE "/posts" "" | replaceRE "/$" ".html" -}} - {{ $url1 := printf "https://seirdy.one/webmentions/get?status=approved&target=https://seirdy.one%s" $target -}} - {{ $url2 := printf "https://seirdy.one/webmentions/get?status=approved&target=https://seirdy.one%s" $oldTarget -}} - {{ $webmentions := (getJSON $url1) | append (getJSON $url2) -}} - {{ range sort $webmentions "created_at" -}} - {{ $webmention := . -}} - {{ if (eq $webmention.type "like") -}} -
- {{- else -}} -
- {{- end -}} - -
- -
-
- {{ if (eq $webmention.type "like") -}} - {{ if $webmention.author_name -}} - {{ $webmention.author_name }} - {{ else if $webmention.title -}} - {{ $webmention.title -}} +
+ Toggle Webmentions +
+ {{- $target := .RelPermalink | replaceRE "^/~seirdy/" "/" }} + {{- $oldTarget := $target | replaceRE "/posts" "" | replaceRE "/$" ".html" -}} + {{ $url1 := printf "https://seirdy.one/webmentions/get?status=approved&target=https://seirdy.one%s" $target -}} + {{ $url2 := printf "https://seirdy.one/webmentions/get?status=approved&target=https://seirdy.one%s" $oldTarget -}} + {{ $webmentions := (getJSON $url1) | append (getJSON $url2) -}} + {{ range sort $webmentions "created_at" -}} + {{ $webmention := . -}} + {{ if (eq $webmention.type "like") -}} +
+ {{- else -}} +
+ {{- end -}} + +
+ +
+
+ {{ if (eq $webmention.type "like") -}} + {{ if $webmention.author_name -}} + {{ $webmention.author_name }} + {{ else if $webmention.title -}} + {{ $webmention.title -}} + {{ else -}} + {{ $webmention.source -}} + {{ end -}} + this {{ else -}} - {{ $webmention.source -}} - {{ end -}} - this - {{ else -}} - - {{- if $webmention.author_name }} - by - {{- end -}} - {{- end }} -
-
- {{ else -}} -
Nothing here
-
This post does not have any approved Webmentions yet.
- {{- end }} -
+ + {{- if $webmention.author_name }} + by + {{- end -}} + {{- end }} +
+
+ {{ else -}} +
Nothing here
+
This post does not have any approved Webmentions yet.
+ {{- end }} +
+

Feel free to contact me directly with feedback; here’s my contact info