diff options
| author | eltrac <hi@eltr.ac> | 2026-03-23 00:58:54 +0800 |
|---|---|---|
| committer | eltrac <hi@eltr.ac> | 2026-03-23 00:58:54 +0800 |
| commit | 4095b42b4e5bb0f7c2f7a8cb52ac480c28899543 (patch) | |
| tree | 73218f316d06875b63ea4dfba1818f890b2fadc6 /layouts | |
| parent | 6b54ade631a56f5e8e15d1442154e1698e30b356 (diff) | |
fix: parse h-card and h-entry correctly
Diffstat (limited to 'layouts')
| -rw-r--r-- | layouts/_partials/posts/action-menu.html | 17 | ||||
| -rw-r--r-- | layouts/_partials/posts/webmention-replies.html | 3 |
2 files changed, 13 insertions, 7 deletions
diff --git a/layouts/_partials/posts/action-menu.html b/layouts/_partials/posts/action-menu.html index 869996b9..f397996d 100644 --- a/layouts/_partials/posts/action-menu.html +++ b/layouts/_partials/posts/action-menu.html @@ -27,19 +27,24 @@ {{ range $webmentions }} {{ $props := index . "microformats" "properties" }} + {{ $type := index . "microformats" "type" 0 }} - {{ if index $props "like-of" }} - {{ $likes = $likes | append . }} + {{ if eq $type "h-entry" }} + {{ if index $props "like-of" }} + {{ $likes = $likes | append . }} - {{ else if index $props "in-reply-to" }} - {{ $replies = $replies | append . }} - {{ else if index $props "repost-of" }} - {{ $reposts = $mentions | append . }} + {{ else if index $props "repost-of" }} + {{ $reposts = $mentions | append . }} + {{ else }} + {{ $replies = $replies | append . }} + + {{ end }} {{ else }} {{ $mentions = $mentions | append . }} {{ end }} + {{ end }} {{ partial "posts/action-area" . }} diff --git a/layouts/_partials/posts/webmention-replies.html b/layouts/_partials/posts/webmention-replies.html index bbdd1111..19e6a352 100644 --- a/layouts/_partials/posts/webmention-replies.html +++ b/layouts/_partials/posts/webmention-replies.html @@ -4,11 +4,12 @@ {{ $reply := index . "microformats" "properties" }} {{ $author := index (index $reply "author") 0 }} {{ $author = index $author "properties" }} + {{ $photo := or (index $author.photo 0) (index $reply.photo 0) }} <div class="relative"> <header class="flex justify-between items-start"> <div class="flex items-center gap-3"> - <img src="{{ index $author.photo 0 }}" alt="Profile Picture" + <img src="{{ $photo }}" alt="Profile Picture" class="h-8 w-8 rd-full" loading="lazy" /> <div class="text-secondary"> <p class="font-bold m-0"> |
