From b5294eb29b5bc5e9738eb683081459ff4721cce0 Mon Sep 17 00:00:00 2001 From: eltrac Date: Wed, 18 Feb 2026 22:32:15 +0800 Subject: perf: use
to toggle webmention display, remove JS --- layouts/_partials/posts/action-menu.html | 12 ++++--- layouts/_partials/posts/webmention-likes.html | 43 ------------------------- layouts/_partials/posts/webmention-summary.html | 43 +++++++++++++++++++++++++ 3 files changed, 50 insertions(+), 48 deletions(-) delete mode 100644 layouts/_partials/posts/webmention-likes.html create mode 100644 layouts/_partials/posts/webmention-summary.html diff --git a/layouts/_partials/posts/action-menu.html b/layouts/_partials/posts/action-menu.html index 9358ce0d..b5204bc2 100644 --- a/layouts/_partials/posts/action-menu.html +++ b/layouts/_partials/posts/action-menu.html @@ -14,17 +14,19 @@ {{ end }} {{ end }} -
- {{ partial "posts/webmention-likes" (dict +
+ + {{ partial "posts/webmention-summary" (dict "likes" $likes "page" . "othercount" (add (len $replies) (len $mentions)) - ) }} - +
{{ partial "posts/webmention-replies" $replies }} {{ partial "posts/webmention-mentions" $mentions }}
{{ partial "posts/comment" . }} -
+
diff --git a/layouts/_partials/posts/webmention-likes.html b/layouts/_partials/posts/webmention-likes.html deleted file mode 100644 index 54fcef4a..00000000 --- a/layouts/_partials/posts/webmention-likes.html +++ /dev/null @@ -1,43 +0,0 @@ -{{ $likes := .likes }} -{{ $page := .page }} -{{ $othercount := .othercount }} - -
- - - - - - - - {{ range $likes }} - - {{ $value := math.Floor (mul math.Rand 80) }} - {{ $rotate := cond (lt $value 40) (sub 10 $value) (sub $value 30) }} - Profile Picture - - {{ end }} -
- {{ printf (T "webmention.likedBy") (len $likes ) }} - {{ if gt $othercount 0 }} - {{ printf (T "webmention.repliedAndMentionedBy") $othercount }} - {{ end }} -
-
-
- diff --git a/layouts/_partials/posts/webmention-summary.html b/layouts/_partials/posts/webmention-summary.html new file mode 100644 index 00000000..65bd8b31 --- /dev/null +++ b/layouts/_partials/posts/webmention-summary.html @@ -0,0 +1,43 @@ +{{ $likes := .likes }} +{{ $page := .page }} +{{ $othercount := .othercount }} + +
+ + + + + + + + {{ range $likes }} + + {{ $value := math.Floor (mul math.Rand 80) }} + {{ $rotate := cond (lt $value 40) (sub 10 $value) (sub $value 30) }} + Profile Picture + + {{ end }} +
+ {{ printf (T "webmention.likedBy") (len $likes ) }} + {{ if gt $othercount 0 }} + {{ printf (T "webmention.repliedAndMentionedBy") $othercount }} + {{ end }} +
+
+
+ -- cgit v1.2.3