Files
theme-earth/templates/modules/widgets/popular-posts.html
Ryan Wang f657f5e62c styles: reformat code
Signed-off-by: Ryan Wang <i@ryanc.cc>
2022-10-10 14:51:02 +08:00

30 lines
1.2 KiB
HTML

<div
class="w-full cursor-pointer overflow-hidden rounded-xl bg-white p-3 shadow transition-all duration-500 hover:shadow-md"
>
<h2 class="inline-flex items-center gap-2 text-base">
<span data-icon="tabler:stairs-up" class="iconify text-lg text-red-600"></span>
热门文章
</h2>
<div>
<ul role="list" class="divide-y divide-gray-100" th:with="posts = ${postFinder.list(1,10)}">
<li class="py-3" th:each="post : ${posts}">
<div class="flex items-center justify-between">
<div class="flex flex-col gap-1">
<h3 class="text-sm font-medium hover:text-gray-500 hover:underline">
<a th:text="${post.spec.title}" th:href="${post.status.permalink}"></a>
</h3>
<p
class="text-xs tabular-nums text-gray-500"
th:text="${#dates.format(post.spec.publishTime,'yyyy-MM-dd')+' 发布'}"
></p>
</div>
<div class="inline-flex items-center gap-1 text-xs text-gray-600">
<span data-icon="tabler:eye" class="iconify"></span>
<span th:text="${post.stats.visit}" class="tabular-nums"> </span>
</div>
</div>
</li>
</ul>
</div>
</div>