修复默认评论侧栏最近评论500问题

This commit is contained in:
1152958806@qq.com 2023-09-17 14:19:36 +08:00
parent 51171e1772
commit 3d02bf2b8c
1 changed files with 16 additions and 13 deletions

View File

@ -4,31 +4,34 @@
<div class="card-widget card-recent-post" th:fragment="comments"> <div class="card-widget card-recent-post" th:fragment="comments">
<div class="item-headline"><i class="haofont hao-icon-comments"></i><span>最新评论</span></div> <div class="item-headline"><i class="haofont hao-icon-comments"></i><span>最新评论</span></div>
<div class="aside-list" id="newcomm"> <div class="aside-list" id="newcomm">
<th:block th:if="${#strings.equals(theme.config.comments.use, 'commentWidget') }"> <th:block th:if="${#strings.equals(theme.config.comments.use, 'commentWidget') }"
<div class="aside-list-item" th:each="comment,iterStat : ${commentFinder.list(null, 1, 20)}" th:with="newcommentnumber = ${theme.config.sidebar.newcommentnumbernewcommentnumber > 0 ? theme.config.sidebar.newcommentnumber : 5}">
<div th:each="comment,iterStat : ${commentFinder.list(null, 1, newcommentnumber)}" class="aside-list-item"
th:with="page = ${comment.spec.subjectRef.kind == 'Post' ? postFinder.getByName(comment.spec.subjectRef.name) : th:with="page = ${comment.spec.subjectRef.kind == 'Post' ? postFinder.getByName(comment.spec.subjectRef.name) :
comment.spec.subjectRef.kind == 'SinglePage' && not #strings.contains('photos,links,moments', comment.spec.subjectRef.name) ? singlePageFinder.getByName(comment.spec.subjectRef.name) : null}, comment.spec.subjectRef.kind == 'SinglePage' && not #strings.contains('photos,links,moments', comment.spec.subjectRef.name) ? singlePageFinder.getByName(comment.spec.subjectRef.name) : null},
url = ${page == null? '/' : page.status.permalink + '#comment-' + comment.metadata.name}" url = ${page == null? '/' : page.status.permalink + '#comment-' + comment.metadata.name}">
th:if="${iterStat.index < theme.config.sidebar.newcommentnumber}">
<span th:text="${commentIndex}"></span> <span th:text="${commentIndex}"></span>
<a class="thumbnail" th:href="${url}" data-pjax-state=""> <a class="thumbnail" th:href="${url}" data-pjax-state="">
<img alt="头像" <img alt="头像"
th:with=" img =${#strings.isEmpty(comment.owner.avatar)?'https://cravatar.cn/avatar/?d=mp':comment.owner.avatar}" th:with=" img =${#strings.isEmpty(comment.owner.avatar)?'https://cravatar.cn/avatar/?d=mp':comment.owner.avatar}"
th:src="${isLazyload ? loadingImg : img}" th:src="${isLazyload ? loadingImg : img}" th:data-lazy-src="${ isLazyload ? img : ''}">
th:data-lazy-src="${ isLazyload ? img : ''}">
</a> </a>
<div class="content" > <div class="content">
<a class="comment" style="display: -webkit-box;-webkit-line-clamp: 2;-webkit-box-orient: vertical;overflow: hidden;" <a class="comment"
th:href="${url}" th:title="${comment.spec.content}" th:text="${comment.spec.content}" data-pjax-state=""> style="display: -webkit-box;-webkit-line-clamp: 2;-webkit-box-orient: vertical;overflow: hidden;"
th:href="${url}" th:title="${comment.spec.content}" th:text="${comment.spec.content}"
data-pjax-state="">
</a> </a>
<div class="name"> <div class="name">
<span th:text="${comment.owner.displayName + ' / '}">stonewu / </span> <span th:text="${comment.owner.displayName + ' / '}">stonewu / </span>
<time th:datetime="${#dates.format(comment.metadata.creationTimestamp, 'yyyy-MM-dd HH:mm:ss')}"></time> <time
th:datetime="${#dates.format(comment.metadata.creationTimestamp, 'yyyy-MM-dd HH:mm:ss')}"></time>
</div> </div>
</div> </div>
</div> </div>
</th:block> </th:block>
</div> </div>
</div> </div>
</html> </html>