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 value: true
- label: 关闭 - label: 关闭
value: false value: false
- $formkit: radio
name: article_date_show
label: 文章“发表于”、“更新于”展示
value: true
options:
- label: 打开
value: true
- label: 关闭
value: false
- $formkit: group - $formkit: group
name: aiDescription name: aiDescription
label: 文章 AI 摘要 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

@ -41,14 +41,6 @@
<div class="content" th:text="${post.status.excerpt}"></div> <div class="content" th:text="${post.status.excerpt}"></div>
</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"> <div class="article-meta-wrap">
<!-- tag --> <!-- tag -->
<th:block th:if="${not #lists.isEmpty(post.tags)}"> <th:block th:if="${not #lists.isEmpty(post.tags)}">
@ -63,28 +55,40 @@
</span> </span>
</th:block> </th:block>
<!-- 创建时间 --> <!-- 创建时间 -->
<span class="post-meta-date" th:with="days=${(new java.util.Date().getTime()-post.spec.publishTime.toEpochMilli())/86400000}"> <span class="post-meta-date"
<i class="far fa-calendar-alt"></i> th:with="days=${(new java.util.Date().getTime()-post.spec.publishTime.toEpochMilli())/86400000}">
<time style="display: inline;" <i class="haofont hao-icon-linggan"></i>
<time style="display: inline;color: #a599e9"
th:datetime="${post.spec.publishTime}" th:datetime="${post.spec.publishTime}"
th:if="${days > 30}" 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:text="${days}+天前"
th:title="${#dates.format(post.spec.publishTime,'yyyy-MM-dd')}+创建"> th:title="${#dates.format(post.spec.publishTime,'yyyy-MM-dd')}+创建">
</time> </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:datetime="${post.spec.publishTime}"
th:if="${days == 0}" th:if="${days == 0}"
th:text="最近" th:text="今日上新"
th:title="${#dates.format(post.spec.publishTime,'yyyy-MM-dd')}+创建"> th:title="${#dates.format(post.spec.publishTime,'yyyy-MM-dd')}+创建">
</time> </time>
</span> </span>
</div> </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> </div>
<!-- 文章卡片擦亮效果 --> <!-- 文章卡片擦亮效果 -->
@ -101,6 +105,7 @@
transition: transform 0.5s linear; transition: transform 0.5s linear;
z-index: 1; z-index: 1;
} }
#recent-posts > .recent-post-item:not(a):hover::before { #recent-posts > .recent-post-item:not(a):hover::before {
transform: translateX(100%) skewX(-60deg); transform: translateX(100%) skewX(-60deg);
} }
@ -108,8 +113,9 @@
<style> <style>
.dateshow { .dateshow {
font-size: 12px;
position: absolute; position: absolute;
bottom: 55px; bottom: 10px;
transition: 0.3s; transition: 0.3s;
display: flex; display: flex;
flex-direction: row; flex-direction: row;
@ -118,14 +124,18 @@
left: 0; left: 0;
padding: 0 32px; padding: 0 32px;
white-space: nowrap; white-space: nowrap;
color: var(--heo-fontcolor);
height: 20px;
} }
i.haofont.hao-icon-calendar-alt.dateshowicon { i.haofont.hao-icon-calendar-alt.dateshowicon {
font-size: 20px; font-size: 14px;
margin-top: 6px; margin-top: 5px;
} }
i.haofont.hao-icon-history.dateshowicon { i.haofont.hao-icon-history.dateshowicon {
font-size: 20px; font-size: 14px;
margin-top: 6px; margin-top: 5px;
} }
</style> </style>
</div> </div>

View File

@ -61,7 +61,7 @@
</th:block> </th:block>
<span class="sidebar-menu-item-title">标签</span> <span class="sidebar-menu-item-title">标签</span>
<div class="card-widget card-tags card-archives card-webinfo card-allinfo" <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="item-headline"></div>
<div class="card-tag-cloud"> <div class="card-tag-cloud">
<a class="tag-item" style="font-size:1em" th:each="tag,iterStat : ${tags}" <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 repo: https://githubfast.com/liuzhihang/halo-theme-hao
settingName: "theme-hao-setting" settingName: "theme-hao-setting"
configMapName: "theme-hao-configMap" configMapName: "theme-hao-configMap"
version: "1.4.5" version: "1.4.6-beta1"
require: ">=2.10.0" require: ">=2.10.0"