Skip to content

Commit 996a9ca

Browse files
fix: 部分页面优化以及问题修复
1 parent 7e5685b commit 996a9ca

18 files changed

+68
-200
lines changed

README.md

+1-10
Original file line numberDiff line numberDiff line change
@@ -5,17 +5,8 @@
55
基于 [LoveIt](https://github.com/dillonzq/LoveIt) Hugo 主题模版进行开发
66

77
初始化设置步骤如下:
8-
9-
- [x] 安装主题后,需要在 Halo 的管理后台(Console 端)设置,在「菜单」—「主菜单」中,依次设置四个菜单项:
10-
- 【菜单1】**名称**:所有文章;**类型**:自定义链接;**链接地址**:/archives;其他为默认
11-
- 【菜单2】**名称**:标签;**类型**:自定义链接;**链接地址**:/tags;其他为默认
12-
- 【菜单3】**名称**:分类;**类型**:自定义链接;**链接地址**:/categories;其他为默认
13-
- 【菜单4】**类型**:自定义页面;**自定义页面**:选择「关于」页面;其他为默认
14-
15-
上述设置完成后,提交并保存,并且重载主题配置刷新。
16-
17-
188
- [x] 如果需要展示博客内容,需要在 Console 端添加 **文章 / 标签 / 分类**,然后将文章在设置里划分到对应的标签和分类中
9+
- [x] 该主题需要配合 Halo 官方的评论组件、搜索组件的插件使用
1910

2011
注:如果主题的部分样式丢失,可在 Console 端的主题 tag 菜单底部点击保存并再次刷新主题页面查看效果
2112

settings.yaml

-68
Original file line numberDiff line numberDiff line change
@@ -89,18 +89,6 @@ spec:
8989
name: svg
9090
label: 自定义 svg 图标(无对应 icon 时可选)
9191
value:
92-
- group: system
93-
label: 主题参数
94-
formSchema:
95-
- $formkit: attachment
96-
name: svgFavicon
97-
label: 站点图标
98-
help: "支持 png、ico、svg 格式"
99-
accepts:
100-
- "image/png"
101-
- "image/ico"
102-
- "image/svg"
103-
value: /themes/theme-clear/assets/img/avatar.png
10492
- group: bottombar
10593
label: 底部
10694
formSchema:
@@ -116,59 +104,3 @@ spec:
116104
name: icp
117105
label: icp 备案号
118106
value: 123456
119-
- group: about
120-
label: 关于
121-
formSchema:
122-
- $formkit: repeater
123-
name: top_desc
124-
id: top_desc
125-
key: top_desc
126-
label: 顶部描述
127-
value:
128-
- desc: 这是一段描述1
129-
- desc: 这是一段描述2
130-
children:
131-
- $formkit: text
132-
name: desc
133-
label: 顶部描述内容
134-
value:
135-
- $formkit: repeater
136-
name: content
137-
label: 内容描述
138-
value:
139-
- h2_desc: 这是一段描述1
140-
items:
141-
- desc: 描述1下子列表1
142-
- desc: 描述1下子列表2
143-
- desc: 描述1下子列表3
144-
- h2_desc: 这是一段描述2
145-
items:
146-
- desc: 描述2下子列表2
147-
- desc: 描述2下子列表2
148-
- desc: 描述2下子列表2
149-
children:
150-
- $formkit: text
151-
name: h2_desc
152-
label: h2 标题描述
153-
value:
154-
- $formkit: repeater
155-
name: items
156-
label: 描述下子列表
157-
value: [ ]
158-
children:
159-
- $formkit: text
160-
name: desc
161-
label: 列表单行描述
162-
value: ""
163-
- $formkit: text
164-
name: themeName
165-
label: 主题名称
166-
value: Clear
167-
- $formkit: attachment
168-
name: themeImg
169-
label: 主题预览图
170-
value: /themes/theme-clear/assets/img/Apple-Devices-Preview.png
171-
- $formkit: text
172-
name: imgDesc
173-
label: 主题预览图描述
174-
value: Halo 主题 Clear

templates/about.html

-55
This file was deleted.

templates/assets/js/beacon.min.js

+1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
178 KB
Binary file not shown.
103 KB
Binary file not shown.
59.1 KB
Binary file not shown.
23.4 KB
Binary file not shown.
379 KB
Binary file not shown.
151 KB
Binary file not shown.
10.3 KB
Binary file not shown.
Binary file not shown.

templates/modules/foot/footer.html

+11-13
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,6 @@
11
<footer class=footer>
22
<div class=footer-container>
3-
<div class=footer-line>
4-
5-
<a href=https://halo.run/ target=_blank rel="noopener noreffer" title="Halo 2.11.0">
6-
Halo
7-
</a>
8-
强力驱动 | 来源主题 -
9-
<a href=https://github.com/dillonzq/LoveIt target=_blank rel="noopener noreffer"
10-
title="LoveIt 0.2.11">
11-
<i class="far fa-kiss-wink-heart fa-fw" aria-hidden=true>
12-
</i>
13-
LoveIt
14-
</a>
15-
</div>
3+
164
<div class=footer-line itemscope itemtype=http://schema.org/CreativeWork>
175
<i class="far fa-copyright fa-fw" aria-hidden=true>
186
</i>
@@ -34,5 +22,15 @@
3422
<span class="icp-splitter">&nbsp;|&nbsp;</span><br class="icp-br"/>ICP 备
3523
<span class="icp" th:text="${theme.config.bottombar.icp}"></span>
3624
</div>
25+
<div class=footer-line>
26+
Powered By
27+
<a href=https://halo.run/ target=_blank rel="noopener noreffer" title="Halo 2.11.0">
28+
Halo
29+
</a>
30+
</div>
31+
32+
<footer>
33+
<halo:footer/>
34+
</footer>
3735
</div>
3836
</footer>

templates/modules/head/link.html

+4-15
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,16 @@
1-
<th:block th:if="${theme.config.system.svgFavicon != ''}">
2-
<link rel="icon" th:href="@{${theme.config.system.svgFavicon}}">
3-
</th:block>
4-
<th:block th:if="${theme.config.system.svgFavicon == ''}">
5-
<link rel="shortcut icon" type="image/x-icon" th:href="@{/assets/img/favicon.ico}"/>
6-
<link rel="icon" type="image/png" sizes="32x32" th:href="@{/assets/img/favicon-32x32.png}">
7-
<link rel="icon" type="image/png" sizes="16x16" th:href="@{/assets/img/favicon-16x16.png}">
8-
<link rel="apple-touch-icon" sizes="180x180" th:href="@{/assets/img/apple-touch-icon.png}">
9-
</th:block>
10-
111
<link rel=mask-icon th:href="@{/assets/img/safari-pinned-tab.svg}" color=#5bbad5>
122
<link rel=manifest th:href="@{/assets/img/site.webmanifest}">
13-
<link rel=canonical href=https://hugoloveit.com/zh-cn/>
143
<link rel=stylesheet th:href="@{/assets/css/style.min.css}">
154

16-
<link rel=preload href=https://cdn.jsdelivr.net/npm/@fortawesome/[email protected]/css/all.min.css as=style
5+
<link rel=preload th:href="@{/assets/css/all.min.css}" as=style
176
onload='this.onload=null; this.rel="stylesheet"'>
187
<noscript>
19-
<link rel=stylesheet href=https://cdn.jsdelivr.net/npm/@fortawesome/[email protected]/css/all.min.css>
8+
<link rel=stylesheet th:href="@{/assets/css/all.min.css}">
209
</noscript>
21-
<link rel=preload href=https://cdn.jsdelivr.net/npm/animate.css@4.1.1/animate.min.css as=style
10+
<link rel=preload th:href="@{/assets/css/animate.min.css}" as=style
2211
onload='this.onload=null; this.rel="stylesheet"'>
2312
<noscript>
24-
<link rel=stylesheet href=https://cdn.jsdelivr.net/npm/animate.css@4.1.1/animate.min.css>
13+
<link rel=stylesheet th:href="@{/assets/css/animate.min.css}">
2514
</noscript>
2615

2716
<link rel=stylesheet th:href="@{/assets/css/cookieconsent.min.css}">

templates/modules/head/seo.html

-22
This file was deleted.

templates/modules/layout.html

+6-10
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,12 @@
11
<!DOCTYPE html>
22
<html lang="en" th:fragment="html (content)" xmlns:th="https://www.thymeleaf.org">
33
<head>
4-
<meta charset="UTF-8" />
5-
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
6-
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
4+
<meta charset="UTF-8"/>
5+
<meta http-equiv="X-UA-Compatible" content="IE=edge"/>
6+
<meta name="viewport" content="width=device-width, initial-scale=1.0"/>
77
<title th:text="${site.title}"></title>
8-
<th:block th:replace="~{modules/head/meta.html}" />
9-
<th:block th:replace="~{modules/head/link.html}" />
10-
<th:block th:replace="~{modules/head/seo.html}" />
8+
<th:block th:replace="~{modules/head/meta.html}"/>
9+
<th:block th:replace="~{modules/head/link.html}"/>
1110
</head>
1211
<body data-header-desktop=fixed data-header-mobile=auto>
1312
<script type="text/javascript">
@@ -42,10 +41,7 @@
4241
<script type=text/javascript th:src="@{/assets/js/clipboard.min.js}"></script>
4342
<script type=text/javascript th:src="@{/assets/js/sharer.min.js}"></script>
4443
<script type=text/javascript th:src="@{/assets/js/index.umd.js}"></script>
45-
<script defer
46-
src="https://static.cloudflareinsights.com/beacon.min.js/v84a3a4012de94ce1a686ba8c167c359c1696973893317"
47-
crossorigin="anonymous">
48-
</script>
44+
<script defer th:src="@{/assets/js/beacon.min.js}" crossorigin="anonymous"></script>
4945
<script type=text/javascript th:src="@{/assets/js/theme.min.js}"></script>
5046
</body>
5147
</html>

templates/page.html

+38
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
<!DOCTYPE html>
2+
<html xmlns:th="https://www.thymeleaf.org" xmlns:halo="http://java.sun.com/xml/ns/javaee"
3+
th:replace="~{modules/layout :: html(title = ${singlePage.spec.title} + ' - ' + ${site.title}, content = ~{::content})}"
4+
>
5+
<th:block th:fragment="content">
6+
7+
<div class="page single special">
8+
<h1 class="single-title animate__animated animate__pulse animate__faster">
9+
<th:block th:text="${singlePage.spec.title}"></th:block>
10+
</h1>
11+
<div class=content id=content>
12+
<figure th:if="${not #strings.isEmpty(singlePage.spec.cover)}">
13+
<img class=lazyload th:src="${singlePage.spec.cover}"
14+
data-sizes=auto th:alt="${singlePage.spec.cover}" width=3200 height=2048>
15+
</figure>
16+
<article>
17+
<div th:utext="${singlePage.content.content}"></div>
18+
</article>
19+
</div>
20+
<!-- 后续做评论组件 -->
21+
<div id=comments class=comment>
22+
<halo:comment
23+
group="content.halo.run"
24+
kind="SinglePage"
25+
th:attr="name=${singlePage.metadata.name}"
26+
colorScheme="'light'"
27+
/>
28+
</div>
29+
</div>
30+
31+
</th:block>
32+
</html>
33+
34+
<script type=text/javascript>
35+
window.config = {
36+
data: {},
37+
}
38+
</script>

theme.yaml

+7-7
Original file line numberDiff line numberDiff line change
@@ -7,17 +7,17 @@ spec:
77
author:
88
name: Halo
99
website: https://www.halo.run
10-
description: A development starter theme with Vite Ecosystem for Halo
10+
description: A simple, elegant and efficient Halo theme
1111
logo: https://www.halo.run/logo
1212
website: https://github.com/f2ccloud/theme-clear
1313
repo: https://github.com/f2ccloud/theme-clear.git
1414
settingName: "theme-clear-setting"
1515
configMapName: "theme-clear-configMap"
1616
version: 1.0.0
1717
require: ">=2.0.0"
18-
customTemplates:
19-
page:
20-
- name: 关于
21-
description: 关于
22-
screenshot:
23-
file: about.html
18+
# customTemplates:
19+
# page:
20+
# - name: 关于
21+
# description: 关于
22+
# screenshot:
23+
# file: about.html

0 commit comments

Comments
 (0)