summaryrefslogtreecommitdiff
path: root/layouts/_partials/posts
diff options
context:
space:
mode:
authoreltrac <hi@eltr.ac>2026-03-16 17:58:30 +0800
committereltrac <hi@eltr.ac>2026-03-16 17:58:30 +0800
commit89d211de0d7427b4fa0224855727dc5d40342b50 (patch)
treeac969f6a142770a34c1e7f1282cc11004e6e5eb8 /layouts/_partials/posts
parent5400e3008ae0e2d42355fbac23a829c081331628 (diff)
fix: use h-card microformats
Diffstat (limited to 'layouts/_partials/posts')
-rw-r--r--layouts/_partials/posts/webmention-mentions.html13
1 files changed, 9 insertions, 4 deletions
diff --git a/layouts/_partials/posts/webmention-mentions.html b/layouts/_partials/posts/webmention-mentions.html
index 8019fe6e..2af5f79d 100644
--- a/layouts/_partials/posts/webmention-mentions.html
+++ b/layouts/_partials/posts/webmention-mentions.html
@@ -4,13 +4,18 @@
{{ range . }}
{{ if index . "microformats" }}
{{ $mf := index . "microformats" "properties" }}
- {{ $author := index (index (index $mf "author") 0) "properties" }}
+ {{ $author := (index (index ($mf.author) 0) "properties") }}
+ {{ if eq (index .microformats.type 0) "h-card" }}
+ {{ $author = $mf }}
+ {{ end }}
{{ $photo := or (index . "extra" "proxied-photo")
(index $author.photo 0) }}
- <li class="flex gap-2"><img src="{{ $photo }}" class="h-5 w-5 rd-full w-auto inline m-0">
+ <li class="flex gap-2">
+ <img src="{{ $photo }}" class="h-5 w-5 rd-full w-auto inline m-0">
<a href="{{ index $author.url 0 }}">{{ index $author.name 0 }}</a>
- <a href="{{ .webmention.source }}">{{ T "webmention.mentionedThisPost" . }}</a></li>
- {{ else }}
+ <a href="{{ .webmention.source }}">{{ T "webmention.mentionedThisPost" . }}</a>
+ </li>
+ {{ else }}
<li><a href="{{ .webmention.source }}" target="_blank">{{ .webmention.source }}</a></li>
{{ end }}
{{ end }}