Skip to content

Commit 442c82e

Browse files
refactor: 页面优化,更新 README.md
1 parent 7b32c9b commit 442c82e

11 files changed

+48
-99
lines changed

README.md

+25-16
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,32 @@
1-
# ThemeMin Vite Starter
1+
# Clear 主题使用与限制
22

3-
一个集成了 Vite 的主题快速开始模板。
3+
基于 Halo2.0 开发,将当前目录压缩为 zip 包后安装
44

5-
主题开发文档可查阅:<https://docs.halo.run/2.0.0-SNAPSHOT/developer-guide/theme/prepare>
5+
基于 [LoveIt](https://github.com/dillonzq/LoveIt) Hugo 主题模版进行开发
66

7-
## 开发
7+
初始化设置步骤如下:
88

9-
```bash
10-
git clone [email protected]:halo-dev/theme-vite-starter.git ~/halo2-dev/themes/theme-vite-starter
11-
```
9+
- [x] 安装主题后,需要在 Halo 的管理后台(Console 端)设置,在「菜单」—「主菜单」中,依次设置四个菜单项:
10+
- 【菜单1】**名称**:所有文章;**类型**:自定义链接;**链接地址**:/archives;其他为默认
11+
- 【菜单2】**名称**:标签;**类型**:自定义链接;**链接地址**:/tags;其他为默认
12+
- 【菜单3】**名称**:分类;**类型**:自定义链接;**链接地址**:/categories;其他为默认
13+
- 【菜单4】**类型**:自定义页面;**自定义页面**:选择「关于」页面;其他为默认
1214

13-
```bash
14-
cd ~/halo2-dev/themes/theme-vite-starter
15-
```
15+
上述设置完成后,提交并保存,并且重载主题配置刷新。
1616

17-
```bash
18-
pnpm install
19-
```
2017

21-
```bash
22-
pnpm dev
23-
```
18+
- [x] 如果需要展示博客内容,需要在 Console 端添加 **文章 / 标签 / 分类**,然后将文章在设置里划分到对应的标签和分类中
19+
20+
注:如果主题的部分样式丢失,可在 Console 端的主题 tag 菜单底部点击保存并再次刷新主题页面查看效果
21+
22+
预览效果
23+
![clear1.jpg](clear1.jpg)
24+
25+
![clear2.jpg](clear2.jpg)
26+
27+
预览地址:
28+
http://43.136.69.44:8090/
29+
30+
如有版权问题请联系 [email protected] 进行修改
31+
32+
主题开发参考 [Halo官方文档](https://docs.halo.run)

clear1.jpg

1.7 MB
Loading

clear2.jpg

476 KB
Loading

settings.yaml

-4
Original file line numberDiff line numberDiff line change
@@ -92,10 +92,6 @@ spec:
9292
- group: system
9393
label: 主题参数
9494
formSchema:
95-
- $formkit: text
96-
name: version
97-
label: 主题版本
98-
value: "1.0.0"
9995
- $formkit: attachment
10096
name: svgFavicon
10197
label: 站点图标

templates/about.html

+11-17
Original file line numberDiff line numberDiff line change
@@ -72,11 +72,9 @@ <h3 id=下载安装>
7272
<li>
7373
<i class="fa fa-download" aria-hidden="true"></i>
7474
&nbsp;下载
75-
<strong>
76-
<a href=https://github.com/john1298308460/theme-clear target=_blank rel="noopener noreffer">
77-
releases
78-
</a>
79-
</strong>
75+
<a href=https://github.com/f2ccloud/theme-clear target=_blank rel="noopener noreffer">
76+
releases
77+
</a>
8078
通过 Halo Console 后台主题安装处上传即可。
8179
</li>
8280
</ul>
@@ -140,11 +138,9 @@ <h3 id=社交和评论系统>
140138
<i class="fas fa-comment-dots fa-fw" aria-hidden=true>
141139
</i>
142140
&nbsp;支持
143-
<strong>
144-
<a href=https://github.com/halo-dev/plugin-comment-widget target=_blank rel="noopener noreffer">
145-
Halo 评论插件
146-
</a>
147-
</strong>
141+
<a href=https://github.com/halo-dev/plugin-comment-widget target=_blank rel="noopener noreffer">
142+
Halo 评论插件
143+
</a>
148144
评论系统
149145
</li>
150146
</ul>
@@ -176,12 +172,10 @@ <h3 id=扩展功能>
176172
<i class="fab fa-font-awesome fa-fw" aria-hidden=true>
177173
</i>
178174
&nbsp;支持
179-
<strong>
180-
<a href=https://fontawesome.com/ target=_blank rel="noopener noreffer">
181-
Font Awesome
182-
</a>
183-
图标
184-
</strong>
175+
<a href=https://fontawesome.com/ target=_blank rel="noopener noreffer">
176+
Font Awesome
177+
</a>
178+
图标
185179
</li>
186180
<li>
187181
<i class="fas fa-i-cursor fa-fw" aria-hidden=true>
@@ -223,7 +217,7 @@ <h2 id=其他>
223217
</h2>
224218
<p>
225219
如果你对主题有什么建议或者意见,欢迎评论区留言,或者提
226-
<a href=https://github.com/john1298308460/theme-clear target=_blank rel="noopener noreffer">
220+
<a href=https://github.com/f2ccloud/theme-clear target=_blank rel="noopener noreffer">
227221
PR & issue
228222
</a>
229223

templates/categories.html

-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
<!DOCTYPE html>
22
<html xmlns:th="https://www.thymeleaf.org" th:replace="~{modules/layout :: html(content = ~{::content})}">
33
<th:block th:fragment="content">
4-
54
<div class="page archive">
65
<h2 class="single-title animate__animated animate__pulse animate__faster">
76
所有分类
@@ -33,7 +32,6 @@ <h3 class=card-item-title>
3332
</div>
3433
</th:block>
3534
</div>
36-
3735
</div>
3836
</th:block>
3937
</html>

templates/modules/head/header.html

+5-30
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
<div class=header-title>
44
<a href=/ title=LoveIt>
55
<span class=header-title-pre>
6-
<img th:src="${theme.config.home.top_logo}" style="height: 24px; width: 24px;" aria-hidden=true />
6+
<img th:src="${theme.config.home.top_logo}" style="height: 24px; width: 24px;" aria-hidden=true/>
77
</span>
88
<th:block th:text="${theme.config.home.top_logo_desc}"></th:block>
99
</a>
@@ -35,18 +35,6 @@
3535
<i class="fas fa-adjust fa-fw" aria-hidden=true>
3636
</i>
3737
</a>
38-
<!-- <a href=javascript:void(0); class="menu-item language" title=选择语言>-->
39-
<!-- <i class="fa fa-globe" aria-hidden=true>-->
40-
<!-- </i>-->
41-
<!-- <select class=language-select id=language-select-desktop onchange="location=this.value">-->
42-
<!-- <option value=/>-->
43-
<!-- English-->
44-
<!-- </option>-->
45-
<!-- <option value=/zh-cn/ selected>-->
46-
<!-- 简体中文-->
47-
<!-- </option>-->
48-
<!-- </select>-->
49-
<!-- </a>-->
5038
</div>
5139
</div>
5240
</div>
@@ -58,11 +46,10 @@
5846
<div class=header-wrapper>
5947
<div class=header-title>
6048
<a href=/ title=LoveIt>
61-
<span class=header-title-pre>
62-
<i class="far fa-kiss-wink-heart fa-fw" aria-hidden=true>
63-
</i>
64-
</span>
65-
LoveIt
49+
<span class=header-title-pre>
50+
<img th:src="${theme.config.home.top_logo}" style="height: 24px; width: 24px;" aria-hidden=true/>
51+
</span>
52+
<th:block th:text="${theme.config.home.top_logo_desc}"></th:block>
6653
</a>
6754
</div>
6855
<div class=menu-toggle id=menu-toggle-mobile>
@@ -110,18 +97,6 @@
11097
<i class="fas fa-adjust fa-fw" aria-hidden=true>
11198
</i>
11299
</a>
113-
<!-- <a href=javascript:void(0); class=menu-item title=选择语言>-->
114-
<!-- <i class="fa fa-globe fa-fw" aria-hidden=true>-->
115-
<!-- </i>-->
116-
<!-- <select class=language-select onchange="location=this.value">-->
117-
<!-- <option value=/>-->
118-
<!-- English-->
119-
<!-- </option>-->
120-
<!-- <option value=/zh-cn/ selected>-->
121-
<!-- 简体中文-->
122-
<!-- </option>-->
123-
<!-- </select>-->
124-
<!-- </a>-->
125100
</div>
126101
</div>
127102
</header>

templates/modules/head/link.html

+4-2
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,13 @@
1313
<link rel=canonical href=https://hugoloveit.com/zh-cn/>
1414
<link rel=stylesheet th:href="@{/assets/css/style.min.css}">
1515

16-
<link rel=preload href=https://cdn.jsdelivr.net/npm/@fortawesome/[email protected]/css/all.min.css as=style onload='this.onload=null; this.rel="stylesheet"'>
16+
<link rel=preload href=https://cdn.jsdelivr.net/npm/@fortawesome/[email protected]/css/all.min.css as=style
17+
onload='this.onload=null; this.rel="stylesheet"'>
1718
<noscript>
1819
<link rel=stylesheet href=https://cdn.jsdelivr.net/npm/@fortawesome/[email protected]/css/all.min.css>
1920
</noscript>
20-
<link rel=preload href=https://cdn.jsdelivr.net/npm/[email protected]/animate.min.css as=style onload='this.onload=null; this.rel="stylesheet"'>
21+
<link rel=preload href=https://cdn.jsdelivr.net/npm/[email protected]/animate.min.css as=style
22+
onload='this.onload=null; this.rel="stylesheet"'>
2123
<noscript>
2224
<link rel=stylesheet href=https://cdn.jsdelivr.net/npm/[email protected]/animate.min.css>
2325
</noscript>

templates/modules/layout.html

-16
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@
88
<th:block th:replace="~{modules/head/meta.html}" />
99
<th:block th:replace="~{modules/head/link.html}" />
1010
<th:block th:replace="~{modules/head/seo.html}" />
11-
<link rel="stylesheet" th:href="@{/assets/dist/style.css}" href="./assets/dist/style.css" />
1211
</head>
1312
<body data-header-desktop=fixed data-header-mobile=auto>
1413
<script type="text/javascript">
@@ -26,8 +25,6 @@
2625
</main>
2726
<th:block th:replace="~{modules/foot/footer}"/>
2827
</div>
29-
30-
3128
<div id=fixed-buttons>
3229
<a href=# id=back-to-top class=fixed-button title=回到顶部>
3330
<i class="fas fa-arrow-up fa-fw" aria-hidden=true>
@@ -38,26 +35,13 @@
3835
</i>
3936
</a>
4037
</div>
41-
42-
4338
<script data-cfasync="false" th:src="@{/assets/js/email-decode.min.js}"></script>
4439
<script type=text/javascript th:src="@{/assets/js/autocomplete.min.js}"></script>
4540
<script type=text/javascript th:src="@{/assets/js/algoliasearch-lite.umd.min.js}"></script>
4641
<script type=text/javascript th:src="@{/assets/js/lazysizes.min.js}"></script>
4742
<script type=text/javascript th:src="@{/assets/js/clipboard.min.js}"></script>
4843
<script type=text/javascript th:src="@{/assets/js/sharer.min.js}"></script>
4944
<script type=text/javascript th:src="@{/assets/js/index.umd.js}"></script>
50-
51-
<!-- <script type=text/javascript th:src="@{/assets/js/ofi.min.js}"></script>-->
52-
<!-- <script type=text/javascript th:src="@{/assets/js/cookieconsent.min.js}"></script>-->
53-
<!-- <script type=text/javascript th:src="@{/assets/js/Valine.min.js}"></script>-->
54-
<!-- <script type=text/javascript th:src="@{/assets/js/gitalk.min.js}"></script>-->
55-
<!-- <script type=text/javascript th:src="@{/assets/js/mapbox-gl-language.js}"></script>-->
56-
<!-- <script type=text/javascript th:src="@{/assets/js/mapbox-gl.min.js}"></script>-->
57-
<!-- <script type=text/javascript th:src="@{/assets/js/lightgallery.min.js}"></script>-->
58-
<!-- <script type=text/javascript th:src="@{/assets/js/auto-render.min.js}"></script>-->
59-
60-
6145
<script defer
6246
src="https://static.cloudflareinsights.com/beacon.min.js/v84a3a4012de94ce1a686ba8c167c359c1696973893317"
6347
crossorigin="anonymous">

templates/post.html

+1-10
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,8 @@ <h1 class="single-title animate__animated animate__flipInX" th:text="${post.spec
1717
</span>
1818
&nbsp;
1919
<span class=post-category>
20-
收录于
21-
2220
<th:block th:if="${not #lists.isEmpty(post.categories)}">
21+
收录于
2322
<a th:href="@{${category.status.permalink}}" th:each="category : ${post.categories}">
2423
<i class="far fa-folder fa-fw" aria-hidden=true>
2524
</i>
@@ -39,9 +38,7 @@ <h1 class="single-title animate__animated animate__flipInX" th:text="${post.spec
3938
</i>
4039
<th:block th:with="content = ${postFinder.content(post.metadata.name)}">
4140
<th:block th:with="wordCount = ${#strings.length(content.content)}">
42-
4341
<span th:text="${wordCount}"></span>
44-
4542
<i class="far fa-clock fa-fw" aria-hidden=true>
4643
</i>
4744
<th:block th:if="${wordCount / 400 lt 1}">
@@ -50,7 +47,6 @@ <h1 class="single-title animate__animated animate__flipInX" th:text="${post.spec
5047
<th:block th:if="${wordCount / 400 ge 1}">
5148
&nbsp;预计阅读 [[${wordCount / 400}]] 分钟&nbsp;
5249
</th:block>
53-
5450
<span class=leancloud_visitors>
5551
<i class="far fa-eye fa-fw" aria-hidden=true>
5652
</i>
@@ -72,7 +68,6 @@ <h1 class="single-title animate__animated animate__flipInX" th:text="${post.spec
7268
<hr/>
7369
</section>
7470
</div>
75-
7671
<div class=post-footer id=post-footer>
7772
<div class=post-info>
7873
<div class=post-info-line>
@@ -107,15 +102,13 @@ <h1 class="single-title animate__animated animate__flipInX" th:text="${post.spec
107102
</span>
108103
</section>
109104
</div>
110-
111105
<div class=post-nav th:with="postCursor = ${postFinder.cursor(post.metadata.name)}">
112106
<a th:if="${postCursor.hasPrevious()}" th:href="@{${postCursor.previous.status.permalink}}" class=prev rel=prev
113107
th:title="${postCursor.previous.spec.title}">
114108
<i class="fas fa-angle-left fa-fw" aria-hidden=true>
115109
</i>
116110
<span th:text="${postCursor.previous.spec.title}"></span>
117111
</a>
118-
119112
<a th:if="${postCursor.hasNext()}" th:href="@{${postCursor.next.status.permalink}}" class=next rel=next
120113
th:title="${postCursor.next.spec.title}">
121114
<i class="fas fa-angle-right fa-fw" aria-hidden=true>
@@ -134,8 +127,6 @@ <h1 class="single-title animate__animated animate__flipInX" th:text="${post.spec
134127
/>
135128
</div>
136129
</article>
137-
138-
139130
</th:block>
140131
</html>
141132

theme.yaml

+2-2
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@ spec:
99
website: https://www.halo.run
1010
description: A development starter theme with Vite Ecosystem for Halo
1111
logo: https://www.halo.run/logo
12-
website: https://github.com/john1298308460/theme-clear
13-
repo: https://github.com/john1298308460/theme-clear.git
12+
website: https://github.com/f2ccloud/theme-clear
13+
repo: https://github.com/f2ccloud/theme-clear.git
1414
settingName: "theme-clear-setting"
1515
configMapName: "theme-clear-configMap"
1616
version: 1.0.0

0 commit comments

Comments
 (0)