diff options
| author | BigCoke233 <hi@guhub.cn> | 2026-01-31 10:50:40 +0800 |
|---|---|---|
| committer | BigCoke233 <hi@guhub.cn> | 2026-01-31 10:50:40 +0800 |
| commit | 73b5ce6d3b7dc050c9e734fe5835a5521d176ef3 (patch) | |
| tree | df94569e546e2c81c3ddc9c07f6ed63f84d8e621 /layouts/_partials/posts | |
| parent | 80bdbbcea414d39d293538769a1ab1bd679cbccf (diff) | |
fix: show likes and interaction form when no likes are found
Diffstat (limited to 'layouts/_partials/posts')
| -rw-r--r-- | layouts/_partials/posts/webmention-likes.html | 7 |
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 }} |
