halo-theme-hao/templates/modules/widgets/aside/recent-posts.html
UPToZ 60512830fe 1.侧边栏增加热门文章
2.优化侧边栏爱发电设置
3.优化编辑文章按钮权限控制
4.适配缩略图
5.更新twikoo资源文件到1.6.36版本
6.修复垂直菜单功能
7.最近评论增加头像服务镜像地址配置
2025-06-25 13:29:00 +08:00

22 lines
1.5 KiB
HTML

<div class="card-widget card-recent-post" th:with='
postRandomImg=${#strings.contains(theme.config.layout.postRandomImg,"?") ? theme.config.layout.postRandomImg+"&" : theme.config.layout.postRandomImg+"?"}'>
<div class="item-headline"><i class="haofont hao-icon-eicon_map-2-line1"></i><span>最近发布</span></div>
<div class="aside-list">
<!-- 最新文章,用户可以自定义展示数量 -->
<div class="aside-list-item" th:each="post : ${postFinder.list({page: 1, size: theme.config.sidebar.recentPost, sort: {'spec.publishTime,desc'}})}">
<a class="thumbnail" th:href="@{${post.status.permalink}}" th:title="${post.spec.title}">
<img th:alt="${post.spec.title}"
th:with="img = ${#strings.isEmpty(post.spec.cover) ? postRandomImg+post.spec.title : thumbnail.gen(post.spec.cover, 's')}"
th:src="${isLazyload ? loadingImg : img}"
th:data-lazy-src="${ isLazyload ? img : ''}">
</a>
<div class="content">
<a class="title" th:href="@{${post.status.permalink}}" th:text="${post.spec.title}" th:title="${post.spec.title}"></a>
<time th:attr="datetime=${#dates.format(post.spec.publishTime, 'yyyy-MM-dd HH:mm:ss')}"Add commentMore actions
th:text="${#dates.format(post.spec.publishTime,'yyyy-MM-dd HH:mm:ss')}"
th:title="${#dates.format(post.spec.publishTime,'yyyy-MM-dd HH:mm:ss')}">
</time>
</div>
</div>
</div>
</div>