Merge remote-tracking branch 'origin/main'

This commit is contained in:
1152958806@qq.com 2023-08-03 23:27:20 +08:00
commit 583665349e
10 changed files with 159 additions and 66 deletions

View File

@ -36,7 +36,6 @@ spec:
- $formkit: "textarea"
name: "description"
label: "描述"
value: ""
---
@ -52,12 +51,31 @@ spec:
- $formkit: "attachment"
name: "siteshot"
label: "背景"
value: ""
- $formkit: "text"
name: "label"
label: "标签"
value: ""
- $formkit: "color"
name: "labelColor"
value: "#425AEF"
label: "标签颜色"
label: "标签颜色"
---
apiVersion: v1alpha1
kind: AnnotationSetting
metadata:
generateName: annotation-setting-
spec:
targetRef:
group: "core.halo.run"
kind: PhotoGroup
formSchema:
- $formkit: "attachment"
name: "cover"
label: "分组图片"
- $formkit: "attachment"
name: "background"
label: "分组顶部 banner 图片"
- $formkit: "textarea"
name: "description"
label: "分组描述"

View File

@ -1,6 +1,6 @@
{
"name": "halo-theme-hao",
"version": "1.3.0",
"version": "1.3.1",
"dependencies": {
}
}

View File

@ -219,21 +219,64 @@ spec:
placeholder: 请输入小标题
value: 更多信息请关注 GitHub
help: 支持 HTML 语法
- $formkit: url
name: bikan
label: 必看精选
placeholder: 请输入地址
value: /
- $formkit: url
name: remen
label: 热门文章
placeholder: 请输入地址
value: /
- $formkit: url
name: shiyong
label: 实用教程
placeholder: 请输入地址
value: /
- $formkit: repeater
name: categoryGroup
min: 3
max: 3
value:
- title: "必看精选"
icon: "iconfont icon-book"
url: "/"
colorOneLight: "#358bff"
colorTwoLight: "#15c6ff"
colorOneDark: "#0653b8"
colorTwoDark: "#2fcbff"
- title: "热门文章"
icon: "iconfont icon-burn"
url: "/"
colorOneLight: "#ff6655"
colorTwoLight: "#ffbf37"
colorOneDark: "#e22a16"
colorTwoDark: "#da980c"
- title: "实用教程"
icon: "iconfont icon-book"
url: "/"
colorOneLight: "#18e7ae"
colorTwoLight: "#1eebeb"
colorOneDark: "#099e74"
colorTwoDark: "#0ea4a4"
children:
- $formkit: text
name: title
label: 标题
placeholder: 请输入内容
validation: required
- $formkit: text
name: icon
label: 图标
placeholder: 请输入内容
validation: required
- $formkit: url
name: url
label: 跳转地址
placeholder: 请输入内容
validation: required
- $formkit: color
name: colorOneLight
label: 颜色1 (浅色)
validation: required
- $formkit: color
name: colorTwoLight
label: 颜色2 (浅色)
validation: required
- $formkit: color
name: colorOneDark
label: 颜色1 (深色)
validation: required
- $formkit: color
name: colorTwoDark
label: 颜色2 (深色)
validation: required
- $formkit: group
name: BannerRight
label: Banner 右侧

View File

@ -23,11 +23,11 @@
<div class="card-album">
<th:block th:each="group : ${photoFinder.groupBy()}">
<div class="card" th:onclick="go([[${group.metadata.name}]])">
<img class="card_cover entered loaded"
th:src="${group.spec.cover}">
<img class="card_cover entered loaded"
th:src="${#annotations.get(group, 'cover')}">
<div class="card__content">
<p class="card__category" th:text="${group.spec.displayName}"></p>
<h3 class="card__heading" th:text="${group.spec.description}"></h3>
<h3 class="card__heading" th:text="${#annotations.get(group, 'description')}"></h3>
</div>
</div>
</th:block>

View File

@ -172,9 +172,6 @@
color: #eee;
}
.default-style a:hover {
text-decoration: underline;
}
:root {
--hao-purple: #4976f5;
}

View File

@ -74,18 +74,20 @@
[[${group.spec.displayName}]] ([[${group.links.size}]])
</h2>
<div class="flink-desc">[[${group.metadata.annotations.description}]]</div>
<div class="flink-desc" th:if="${not #strings.isEmpty(#annotations.get(group, 'description'))}">[[${#annotations.get(group, 'description')}]]</div>
<!-- 第一个,使用卡片展示 -->
<div th:if="${#strings.equals(group.metadata.annotations.displayStyle,'beautify') && not #lists.isEmpty(group.links)}"
<div th:if="${#strings.equals(#annotations.get(group, 'displayStyle'),'beautify') && not #lists.isEmpty(group.links)}"
class="site-card-group">
<div class="site-card" th:each="link : ${group.links}">
<span th:if="${not #strings.isEmpty(link.metadata.annotations.label)}"
th:style="'background-color:' + ${link.metadata.annotations.labelColor}"
class="site-card-tag">[[${link.metadata.annotations.label}]]</span>
<span th:if="${not #strings.isEmpty(#annotations.get(link, 'label'))}"
th:style="'background-color:' + ${#annotations.get(link,'labelColor')}"
class="site-card-tag">[[${#annotations.get(link, 'label')}]]</span>
<a class="img" target="_blank" th:href="${link.spec.url}" th:title="${link.spec.displayName}">
<img class="flink-avatar" style="pointer-events: none;" th:alt="${link.spec.displayName}"
th:src="@{${#strings.isEmpty(link.metadata.annotations.siteshot) ? link.spec.logo : link.metadata.annotations.siteshot}}">
th:src="@{${#strings.isEmpty(#annotations.get(link, 'siteshot')) ? link.spec.logo : #annotations.get(link,'siteshot') }}">
</a>
<a class="info cf-friends-link" target="_blank" th:href="${link.spec.url}"
@ -106,11 +108,11 @@
</div>
<div class="flink-list"
th:if="${#strings.equals(group.metadata.annotations.displayStyle,'default') && not #lists.isEmpty(group.links)}">
th:if="${#strings.equals(#annotations.get(group, 'displayStyle'),'default') && not #lists.isEmpty(group.links)}">
<div class="flink-list-item" th:each="link : ${group.links}">
<span th:if="${not #strings.isEmpty(link.metadata.annotations.label)}"
th:style="'background-color:' + ${link.metadata.annotations.labelColor}"
class="site-card-tag">[[${link.metadata.annotations.label}]]</span>
<span th:if="${not #strings.isEmpty(#annotations.get(link, 'label'))}"
th:style="'background-color:' + ${#annotations.get(link,'labelColor')}"
class="site-card-tag">[[${#annotations.get(link, 'label')}]]</span>
<a class="cf-friends-link" rel="external nofollow" target="_blank" th:href="${link.spec.url}"
th:title="${link.spec.displayName}">
<img class="flink-avatar cf-friends-avatar" th:alt="${link.spec.displayName}"
@ -126,7 +128,7 @@
</div>
<div class="flink-list mini"
th:if="${#strings.equals(group.metadata.annotations.displayStyle,'deprecated') && not #lists.isEmpty(group.links)}">
th:if="${#strings.equals(#annotations.get(group, 'displayStyle'),'deprecated') && not #lists.isEmpty(group.links)}">
<div class="flink-list-item" th:each="link : ${group.links}">
<a class="cf-friends-link" rel="external nofollow" target="_blank" th:href="${link.spec.url}"
th:title="${link.spec.displayName}">
@ -150,4 +152,4 @@
</div>
</th:block>
</th:block>
</th:block>

View File

@ -8,9 +8,9 @@
th:if="${pluginFinder.available('PluginLinks')}"
th:with="groups = ${linkFinder.groupBy()}">
<th:block th:each="group,iterStat : ${groups}">
<details th:if="${group.metadata.annotations.displayStyle != 'deprecated' && not #strings.isEmpty(group.metadata.annotations.displayStyle) && not #lists.isEmpty(group.links)}"
<details th:if="${#annotations.get(group, 'displayStyle') != 'deprecated' && not #strings.isEmpty(#annotations.get(group, 'displayStyle')) && not #lists.isEmpty(group.links)}"
class="card-friend-class-name">
<summary class="card-friend-class-desc" th:title="${group.metadata.annotations.description}">
<summary class="card-friend-class-desc" th:title="${#annotations.get(group, 'description')}">
<sapn>[[${group.spec.displayName}]]</sapn>
<sapn>[[${group.links.size}]]</sapn>
</summary>
@ -25,9 +25,9 @@
</div>
</a>
</details>
<details th:if="${#strings.equals(group.metadata.annotations.displayStyle,'deprecated') && not #lists.isEmpty(group.links)}"
<details th:if="${#strings.equals(#annotations.get(group, 'displayStyle'),'deprecated') && not #lists.isEmpty(group.links)}"
class="card-friend-class-name">
<summary class="card-friend-class-desc" th:title="${group.metadata.annotations.description}">
<summary class="card-friend-class-desc" th:title="${#annotations.get(group, 'description')}">
<sapn>[[${group.spec.displayName}]]</sapn>
<sapn>[[${group.links.size}]]</sapn>
</summary>
@ -49,4 +49,4 @@
</div>
</html>
</html>

View File

@ -161,24 +161,54 @@
<!-- category -->
<div class="categoryGroup">
<div class="categoryItem" style="box-shadow:var(--heo-shadow-blue)">
<a class="categoryButton CB1 bikan"
th:href="@{${theme.config.top.BannerLeft.bikan}}">
<span class="categoryButtonText">必看精选</span><i class="iconfont icon-book"></i>
</a>
</div>
<div class="categoryItem" style="box-shadow:var(--heo-shadow-red)">
<a class="categoryButton remen"
th:href="@{${theme.config.top.BannerLeft.remen}}">
<span class="categoryButtonText">热门文章</span><i class="iconfont icon-burn"></i>
</a>
</div>
<div class="categoryItem" style="box-shadow:var(--heo-shadow-green)">
<a class="categoryButton shiyong"
th:href="@{${theme.config.top.BannerLeft.shiyong}}">
<span class="categoryButtonText">实用教程</span><i class="iconfont icon-book"></i>
</a>
</div>
<th:block th:with="groups = ${theme.config.top.BannerLeft.categoryGroup}">
<div class="categoryItem">
<a class="categoryButton CB1 bikan" th:href="@{${groups[0].url}}">
<span class="categoryButtonText">[[${groups[0].title}]]</span><i th:class="${groups[0].icon}"></i>
</a>
</div>
<div class="categoryItem">
<a class="categoryButton remen" th:href="@{${groups[1].url}}">
<span class="categoryButtonText">[[${groups[1].title}]]</span><i th:class="${groups[1].icon}"></i>
</a>
</div>
<div class="categoryItem">
<a class="categoryButton shiyong" th:href="@{${groups[2].url}}">
<span class="categoryButtonText">[[${groups[2].title}]]</span><i th:class="${groups[2].icon}"></i>
</a>
</div>
<style>
a.categoryButton.bikan {
background: linear-gradient(to right, [[${groups[0].colorOneLight}]], [[${groups[0].colorTwoLight}]]);
background-size: 200%;
}
a.categoryButton.remen {
background: linear-gradient(to right, [[${groups[1].colorOneLight}]], [[${groups[1].colorTwoLight}]]);
background-size: 200%;
}
a.categoryButton.shiyong {
background: linear-gradient(to right, [[${groups[2].colorOneLight}]], [[${groups[2].colorTwoLight}]]);
background-size: 200%;
}
[data-theme=dark] a.categoryButton.bikan {
background: linear-gradient(to right, [[${groups[0].colorOneDark}]], [[${groups[0].colorTwoDark}]]);
background-size: 200%;
}
[data-theme=dark] a.categoryButton.remen {
background: linear-gradient(to right, [[${groups[1].colorOneDark}]], [[${groups[1].colorTwoDark}]]);
background-size: 200%;
}
[data-theme=dark] a.categoryButton.shiyong {
background: linear-gradient(to right, [[${groups[2].colorOneDark}]], [[${groups[2].colorTwoDark}]]);
background-size: 200%;
}
</style>
</th:block>
</div>
<script th:inline="javascript">

View File

@ -13,11 +13,14 @@
<div id="page">
<th:block th:each="group : ${photoFinder.groupBy()}">
<th:block th:if="${#strings.equals(group.metadata.name, param.photo_group_name)}">
<th:div th:replace="~{macro/author-content :: author-content(background = ${group.spec.background},
<th:block th:if="${#strings.equals(group.metadata.name, param.photo_group_name)}"
th:with="description = ${#annotations.get(group, 'description')},
background = ${#annotations.get(group, 'background')}">
<th:div th:replace="~{macro/author-content :: author-content(background = ${background},
smallTitle = '相册集',
bigTitle = ${group.spec.displayName},
detail = ${group.spec.description},
detail = ${description},
buttonUrl = '',
buttonTitle = '')}" />
</th:block>

View File

@ -47,5 +47,5 @@ spec:
repo: https://github.com/liuzhihang/halo-theme-hao
settingName: "theme-hao-setting"
configMapName: "theme-hao-configMap"
version: "1.3.0"
require: ">=2.6.0"
version: "1.3.1"
require: ">=2.8.0"