增加置顶文章支持

This commit is contained in:
liuzhihang 2022-11-15 00:31:07 +08:00
parent c316f96a1f
commit 445be573ec
2 changed files with 10 additions and 7 deletions

View File

@ -8902,19 +8902,19 @@ li {
-webkit-box-orient: vertical;
}
.recent-post-item .recent-post-info .recent-post-info-top .lastestpost {
display: none;
}
/*.recent-post-item .recent-post-info .recent-post-info-top .pinned-post {*/
/* display: none;*/
/*}*/
@media screen and (min-width: 1300px) {
#recent-posts > .recent-post-item:nth-child(2) .lastestpost {
#recent-posts > .recent-post-item .pinned-post {
display: flex;
color: var(--heo-lighttext);
font-size: 0.5rem;
position: relative;
}
#recent-posts .recent-post-item.lastestpost-item .recent-post-info-top {
#recent-posts .recent-post-item.pinned-post-item .recent-post-info-top {
padding-top: 16px;
}

View File

@ -6,7 +6,10 @@
<!-- card需要添加在没有图片时使用随机图片 -->
<div class="recent-post-item"
th:classappend="${theme.config.layout.cols} + ' ' + ${theme.config.layout.post_location} + ' ' + (${iStat.even} ? 'even' : 'odd')"
th:classappend="${theme.config.layout.cols} + ' ' +
${theme.config.layout.post_location} + ' ' +
(${iStat.even} ? 'even' : 'odd') +
(${post.spec.pinned} ? 'pinned-post-item' : '')"
th:each="post,iStat : ${postItems}">
<div class="post_cover cover_radius">
@ -29,7 +32,7 @@
</th:block>
<div class="recent-post-info">
<div class="recent-post-info-top">
<span class="lastestpost">最新文章</span>
<span class="pinned-post" th:if="${post.spec.pinned}">置顶</span>
<a class="article-title"
th:attr="title=${post.spec.title}"
th:href="@{${post.status.permalink}}"