summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBigCoke233 <hi@guhub.cn>2026-01-31 10:50:40 +0800
committerBigCoke233 <hi@guhub.cn>2026-01-31 10:50:40 +0800
commit73b5ce6d3b7dc050c9e734fe5835a5521d176ef3 (patch)
treedf94569e546e2c81c3ddc9c07f6ed63f84d8e621
parent80bdbbcea414d39d293538769a1ab1bd679cbccf (diff)
fix: show likes and interaction form when no likes are found
-rw-r--r--layouts/_partials/posts/webmention-likes.html7
1 files changed, 3 insertions, 4 deletions
diff --git a/layouts/_partials/posts/webmention-likes.html b/layouts/_partials/posts/webmention-likes.html
index 46314842..4621ab47 100644
--- a/layouts/_partials/posts/webmention-likes.html
+++ b/layouts/_partials/posts/webmention-likes.html
@@ -1,6 +1,6 @@
{{ $likes := .likes }}
{{ $page := .page }}
-{{ with $likes }}
+
<section class="mb-6 flex gap-2 items-center">
<div class="flex gap-1 group relative">
<a data-tooltip title="互动" class="hover:no-underline cursor-pointer" onclick="toggleActionArea()">
@@ -30,7 +30,7 @@
</form>
</div>
</div>
- {{ range . }}
+ {{ range $likes }}
<a href="{{ .author.url }}" target="_blank" title="{{ .author.name }}">
{{ $value := math.Floor (mul math.Rand 80) }}
{{ $rotate := cond (lt $value 40) (sub 10 $value) (sub $value 30) }}
@@ -40,7 +40,7 @@
</a>
{{ end }}
</div>
- <p class="text-secondary m-0 text-sm">{{ printf (T "webmention.likedBy") (len . ) }}</p>
+ <p class="text-secondary m-0 text-sm">{{ printf (T "webmention.likedBy") (len $likes ) }}</p>
</section>
<script>
@@ -82,5 +82,4 @@ document.addEventListener('click', function(event) {
}
});
</script>
-{{ end }}