From 4095b42b4e5bb0f7c2f7a8cb52ac480c28899543 Mon Sep 17 00:00:00 2001 From: eltrac Date: Mon, 23 Mar 2026 00:58:54 +0800 Subject: fix: parse h-card and h-entry correctly --- layouts/_partials/posts/action-menu.html | 17 +++++++++++------ 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) }}
- Profile Picture

-- cgit v1.2.3