From a349c66a70bea5b17e2d14befa4640dc2f7ed2e3 Mon Sep 17 00:00:00 2001 From: jk Date: Mon, 15 Jun 2020 14:55:51 +0100 Subject: [PATCH] can only test comments in live --- .../nipponalba/layouts/_default/single.html | 25 ++++++++++++------- .../layouts/partials/webmention.html | 20 +++++++++++++++ 2 files changed, 36 insertions(+), 9 deletions(-) create mode 100644 themes/nipponalba/layouts/partials/webmention.html diff --git a/themes/nipponalba/layouts/_default/single.html b/themes/nipponalba/layouts/_default/single.html index d6511035..558ba097 100644 --- a/themes/nipponalba/layouts/_default/single.html +++ b/themes/nipponalba/layouts/_default/single.html @@ -29,7 +29,7 @@
{{ $pathJSON := (print .Permalink "bridgy.json") }} {{ $relpathJSON := (print .RelPermalink "bridgy.json") }} -{{ if fileExists $relpathJSON }} +{{ if fileExists $pathJSON }}
{{ $mJSON := getJSON $pathJSON }} Syndicated to Pleroma @@ -42,14 +42,21 @@
- {{ if eq .Type "article"}} - {{ if .Site.DisqusShortname -}} -
-

Comments

- {{ template "_internal/disqus.html" . }} -
- {{- end }} - {{ end }} +
+
+
+ + + +
+
+{{ $pathJSON := (print "data" (strings.TrimSuffix "/" .Permalink) ".json") }} +{{ if fileExists $pathJSON }} +
+ {{ $mJSON := getJSON $pathJSON }} + {{ partial "webmention.html" $mJSON }} +
+{{ end }} {{ else }} diff --git a/themes/nipponalba/layouts/partials/webmention.html b/themes/nipponalba/layouts/partials/webmention.html new file mode 100644 index 00000000..add7c677 --- /dev/null +++ b/themes/nipponalba/layouts/partials/webmention.html @@ -0,0 +1,20 @@ +{{ range . }} +{{ if eq .mention_type "mention" }} +
{{ .author.name }} mentioned this post in the post {{ .title }}
+{{ end }} +{{ if eq .mention_type "like" }} +
{{ .author.name }} liked
+{{ end }} +{{ if eq .mention_type "reply" }} +
{{ .author.name }} replied to this post here
+{{ end }} +{{ if eq .mention_type "bookmark" }} +
{{ .author.name }} bookmarked this post
+{{ end }} +{{ if eq .mention_type "repost" }} +
{{ .author.name }} reposted this article
+{{ end }} +{{ if eq .mention_type "rsvp" }} +
{{ .author.name }} responded to the rsvp here
+{{ end }} +{{ end }}