Merge pull request #592 from carolcoral/main

fix: 修复移动端情况下标签展示数量控制
This commit is contained in:
Carol 2024-01-02 11:36:12 +08:00 committed by GitHub
commit 4addda5236
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 51 additions and 32 deletions

View File

@ -1307,6 +1307,15 @@ spec:
value: true
- label: 关闭
value: false
- $formkit: radio
name: article_date_show
label: 文章“发表于”、“更新于”展示
value: true
options:
- label: 打开
value: true
- label: 关闭
value: false
- $formkit: group
name: aiDescription
label: 文章 AI 摘要

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -1,7 +1,7 @@
<th:block
th:with='postItems=${posts.items},
th:with='postItems=${posts.items},
postRandomImg=${#strings.contains(theme.config.layout.postRandomImg,"?") ? theme.config.layout.postRandomImg+"&" : theme.config.layout.postRandomImg+"?"}'>
<!-- card需要添加在没有图片时使用随机图片 -->
<div class="recent-post-item"
th:classappend="${theme.config.layout.post.cols} + ' ' +
@ -41,14 +41,6 @@
<div class="content" th:text="${post.status.excerpt}"></div>
</div>
<div class="dateshow">
<i class="haofont hao-icon-calendar-alt dateshowicon"></i>
<span class="banner-button-text" th:text="发表于 + '&nbsp;' + ${#dates.format(post.spec.publishTime,'yyyy-MM-dd')}"></span>
&nbsp;&nbsp;
<i class="haofont hao-icon-history dateshowicon"></i>
<span class="banner-button-text" th:text="更新于 + '&nbsp;' + ${#dates.format(post.status.lastModifyTime,'yyyy-MM-dd')}"></span>
</div>
<div class="article-meta-wrap">
<!-- tag -->
<th:block th:if="${not #lists.isEmpty(post.tags)}">
@ -63,30 +55,42 @@
</span>
</th:block>
<!-- 创建时间 -->
<span class="post-meta-date" th:with="days=${(new java.util.Date().getTime()-post.spec.publishTime.toEpochMilli())/86400000}">
<i class="far fa-calendar-alt"></i>
<time style="display: inline;"
<span class="post-meta-date"
th:with="days=${(new java.util.Date().getTime()-post.spec.publishTime.toEpochMilli())/86400000}">
<i class="haofont hao-icon-linggan"></i>
<time style="display: inline;color: #a599e9"
th:datetime="${post.spec.publishTime}"
th:if="${days > 30}"
th:text="${#dates.format(post.spec.publishTime,'yyyy-MM-dd')}"
th:title="${#dates.format(post.spec.publishTime,'yyyy-MM-dd')}+创建">
</time>
<time style="display: inline;"
th:datetime="${post.spec.publishTime}"
th:if="${days <= 30 && days > 0}"
th:text="${days}+天前"
th:title="${#dates.format(post.spec.publishTime,'yyyy-MM-dd')}+创建">
</time>
<time style="display: inline;"
<time style="display: inline;color: #75a7ca"
th:datetime="${post.spec.publishTime}"
th:if="${days <= 30 && days > 0}"
th:text="最近发布"
th:title="${#dates.format(post.spec.publishTime,'yyyy-MM-dd')}+创建">
</time>
<time style="display: inline;color: #0ec0ea"
th:datetime="${post.spec.publishTime}"
th:if="${days == 0}"
th:text="最近"
th:text="今日上新"
th:title="${#dates.format(post.spec.publishTime,'yyyy-MM-dd')}+创建">
</time>
</span>
</div>
<div class="dateshow" media="screen and (min-width: 1024px)" th:if="${post.article_date_show}">
<i class="haofont hao-icon-calendar-alt dateshowicon"></i>
<span class="banner-button-text"
th:text="发表于 + '&nbsp;' + ${#dates.format(post.spec.publishTime,'yyyy-MM-dd')}"></span>
&nbsp;&nbsp;
<i class="haofont hao-icon-history dateshowicon"></i>
<span class="banner-button-text"
th:text="更新于 + '&nbsp;' + ${#dates.format(post.status.lastModifyTime,'yyyy-MM-dd')}"></span>
</div>
</div>
<!-- 文章卡片擦亮效果 -->
<style th:if="${theme.config.layout.articleCardPolish}">
#recent-posts > .recent-post-item:not(a)::before {
@ -101,6 +105,7 @@
transition: transform 0.5s linear;
z-index: 1;
}
#recent-posts > .recent-post-item:not(a):hover::before {
transform: translateX(100%) skewX(-60deg);
}
@ -108,8 +113,9 @@
<style>
.dateshow {
font-size: 12px;
position: absolute;
bottom: 55px;
bottom: 10px;
transition: 0.3s;
display: flex;
flex-direction: row;
@ -118,18 +124,22 @@
left: 0;
padding: 0 32px;
white-space: nowrap;
color: var(--heo-fontcolor);
height: 20px;
}
i.haofont.hao-icon-calendar-alt.dateshowicon {
font-size: 20px;
margin-top: 6px;
font-size: 14px;
margin-top: 5px;
}
i.haofont.hao-icon-history.dateshowicon {
font-size: 20px;
margin-top: 6px;
font-size: 14px;
margin-top: 5px;
}
</style>
</div>
<!-- 分页 -->
<div th:replace="~{modules/widgets/page :: page('',${posts},true,'')}"></div>

View File

@ -61,7 +61,7 @@
</th:block>
<span class="sidebar-menu-item-title">标签</span>
<div class="card-widget card-tags card-archives card-webinfo card-allinfo"
th:with="tags = ${tagFinder.listAll()}">
th:with="tags = ${tagFinder.listAll()}, tagQuantity = ${#conversions.convert(theme.config.sidebar.tagQuantity, 'java.lang.Integer')}">
<div class="item-headline"></div>
<div class="card-tag-cloud">
<a class="tag-item" style="font-size:1em" th:each="tag,iterStat : ${tags}"

View File

@ -51,5 +51,5 @@ spec:
repo: https://githubfast.com/liuzhihang/halo-theme-hao
settingName: "theme-hao-setting"
configMapName: "theme-hao-configMap"
version: "1.4.5"
version: "1.4.6-beta1"
require: ">=2.10.0"