fix: resolve sorting issue in popular posts widget (#208)

Signed-off-by: Ryan Wang <i@ryanc.cc>
This commit is contained in:
Ryan Wang
2024-11-15 21:31:08 +08:00
committed by GitHub
parent 75731b7ba8
commit 43616aff40

View File

@@ -6,7 +6,11 @@
热门文章
</h2>
<div>
<ul role="list" class="divide-y divide-gray-100 dark:divide-slate-700" th:with="posts = ${postFinder.list(1,10)}">
<ul
role="list"
class="divide-y divide-gray-100 dark:divide-slate-700"
th:with="posts = ${postFinder.list({page: 1,size: 10,sort: {'stats.visit,desc'}})}"
>
<li class="py-3" th:each="post : ${posts}">
<div class="flex items-center justify-between">
<div class="flex flex-col gap-1">
@@ -20,7 +24,7 @@
</div>
<div class="inline-flex items-center gap-1 text-xs text-gray-600 dark:text-slate-500">
<span class="i-tabler-eye"></span>
<span th:text="${post.stats.visit}" class="tabular-nums"> </span>
<span th:text="${post.stats.visit ?: 0}" class="tabular-nums"> </span>
</div>
</div>
</li>