mirror of
https://ghfast.top/https://github.com/zsjy/halo-theme-dream2.0-plus.git
synced 2025-03-15 20:09:41 +08:00
调整配置项 侧边栏最近文章-显示”置顶”标记 为 侧边栏最近文章-显示模式,根据选择对最新文章侧边栏进行排序
This commit is contained in:
parent
9162bd725d
commit
1a736730c7
@ -919,14 +919,14 @@ spec:
|
|||||||
label: 不显示
|
label: 不显示
|
||||||
- $formkit: radio
|
- $formkit: radio
|
||||||
name: recent_posts_pinned
|
name: recent_posts_pinned
|
||||||
label: 侧边栏最近文章-显示”置顶”标记
|
label: 侧边栏最近文章-显示模式
|
||||||
value: false
|
value: false
|
||||||
help: '侧边栏最近文章是否显示”置顶”标记。'
|
help: '侧边栏最近文章显示模式,置顶优先:优先显示置顶文章,同时显示置顶标记,发布优先:优先显示最新发布的文章,不显示置顶标记。'
|
||||||
options:
|
options:
|
||||||
- value: true
|
- value: true
|
||||||
label: 显示
|
label: 置顶优先
|
||||||
- value: false
|
- value: false
|
||||||
label: 不显示
|
label: 发布优先
|
||||||
- $formkit: number
|
- $formkit: number
|
||||||
name: recent_comments_num
|
name: recent_comments_num
|
||||||
label: 侧边栏最近评论-展示评论数量
|
label: 侧边栏最近评论-展示评论数量
|
||||||
|
@ -1,7 +1,10 @@
|
|||||||
<div xmlns:th="https://www.thymeleaf.org"
|
<div xmlns:th="https://www.thymeleaf.org"
|
||||||
th:fragment="widget (sidebar)"
|
th:fragment="widget (sidebar)"
|
||||||
th:class="'card widget recent-posts ' + ${sidebar.hide}"
|
th:class="'card widget recent-posts ' + ${sidebar.hide}"
|
||||||
th:with="num = ${#strings.isEmpty(theme.config.sidebar.recent_posts_num)? 5 : T(java.lang.Integer).parseInt(theme.config.sidebar.recent_posts_num)}, posts = ${postFinder.list(1,num)}, isEmpty = ${#lists.isEmpty(posts)}">
|
th:with="num = ${#strings.isEmpty(theme.config.sidebar.recent_posts_num)? 5 : T(java.lang.Integer).parseInt(theme.config.sidebar.recent_posts_num)},
|
||||||
|
sortCondition = ${theme.config.sidebar.recent_posts_pinned ? {'spec.pinned,desc', 'spec.publishTime,desc', 'metadata.creationTimestamp,desc'} : {'spec.publishTime,desc', 'metadata.creationTimestamp,desc'}},
|
||||||
|
posts = ${postFinder.list({page: 1, size: num, sort: sortCondition})},
|
||||||
|
isEmpty = ${#lists.isEmpty(posts)}">
|
||||||
<div class="card-title">
|
<div class="card-title">
|
||||||
<i th:class="${#strings.defaultString(sidebar.icon, 'ri-history-line') + ' card-title-label'}"></i><span th:text="${#strings.defaultString(sidebar.title, '最新文章')}"></span>
|
<i th:class="${#strings.defaultString(sidebar.icon, 'ri-history-line') + ' card-title-label'}"></i><span th:text="${#strings.defaultString(sidebar.title, '最新文章')}"></span>
|
||||||
<a th:if="${theme.config.sidebar.recent_posts_more}" class="card-more" th:href="@{/archives}">更多<i class="ri-arrow-right-double-line"></i></a>
|
<a th:if="${theme.config.sidebar.recent_posts_more}" class="card-more" th:href="@{/archives}">更多<i class="ri-arrow-right-double-line"></i></a>
|
||||||
|
@ -30,7 +30,7 @@ spec:
|
|||||||
settingName: theme-dream2-plus-setting
|
settingName: theme-dream2-plus-setting
|
||||||
configMapName: theme-dream2-plus-configMap
|
configMapName: theme-dream2-plus-configMap
|
||||||
# 版本号
|
# 版本号
|
||||||
version: 1.3.2.beta1
|
version: 1.3.2.beta2
|
||||||
# 最低支持的 Halo 版本
|
# 最低支持的 Halo 版本
|
||||||
require: ">=2.20.0"
|
require: ">=2.20.0"
|
||||||
# 许可
|
# 许可
|
||||||
|
Loading…
x
Reference in New Issue
Block a user