mirror of
https://github.com/halo-dev/theme-earth.git
synced 2025-10-14 06:21:09 +00:00
fix: resolve sorting issue in popular posts widget (#208)
Signed-off-by: Ryan Wang <i@ryanc.cc>
This commit is contained in:
@@ -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>
|
||||
|
Reference in New Issue
Block a user