Compare commits

..

No commits in common. "dev" and "main" have entirely different histories.
dev ... main

10 changed files with 67 additions and 122 deletions

View File

@ -1,44 +1,36 @@
<div align="center">
<!-- 主题Logo -->
<img width="100px" src="https://api.minio.uptoz.cn/blog/images/d1oghFBTxV.webp">
<img width="100px" src="https://api.minio.yyds.pink/moony/files/2024/04/halo-theme-hao-sbxqdmuv.png">
<!-- 主题名称 -->
<h1>Halo-Theme-Hao</h1>
</div>
<!-- 主题预览图 -->
![](https://api.minio.uptoz.cn/blog/images/NsUInjCbZN.webp)
## 🔥 预览
| 站点名称 | 站点地址 |
|:-------------:|:----------------:|
| 小小笔记大大用处 | https://blog.uptoz.cn |
| 站点名称 | 站点地址 |
|:--------------:|:------------------------:|
| 小小笔记大大用处 | https://blog.uptoz.cn |
## 👋 简介
<a href="https://gitea.uptoz.cn/UPToZ/halo-theme-hao/" target="_blank" rel="noopener noreferrer">Halo-Theme-Hao</a>
是一款适用于 <a href="https://github.com/halo-dev/halo/" target="_blank" rel="noopener noreferrer">Halo2.x</a> 的博客主题。
移植自 <a href="https://hexo.io/zh-cn/index.html/" target="_blank" rel="noopener noreferrer">Hexo</a> 社区中 <a href="https://blog.zhheo.com/" target="_blank" rel="noopener noreferrer">张洪 Heo</a> 的博客。
因为原主题从`1.4.9-beta2`版本之后,移除了许多功能模块,并且有些样式变化不符合我的个人审美。
故现主题从原仓库 <a href="https://github.com/chengzhongxue/halo-theme-hao" target="_blank" rel="noopener noreferrer">chengzhongxue/halo-theme-hao</a>
<a href="https://github.com/chengzhongxue/halo-theme-hao/releases/tag/v1.4.9-beta2" target="_blank" rel="noopener noreferrer">1.4.9-Beta2</a> 版本的源码Fork到我个人仓库并进行了微调。
[Halo-Theme-Hao](https://gitea.uptoz.cn/UPToZ/halo-theme-hao)
是一款适用于 [Halo2.x](https://github.com/halo-dev/halo) 的博客主题。
移植自 [Hexo](https://hexo.io/zh-cn/index.html) 社区中 [张洪 Heo](https://blog.zhheo.com/)
对 [Hexo-Theme-hao](https://github.com/chengzhongxue/halo-theme-hao)主题1.4.9-beta2的魔改版本。
## 🚨 注意事项(看我看我)
1. **建站时间必填**
2. 如果安装主题后报错,请仔细查阅<a href="https://gitea.uptoz.cn/UPToZ/halo-theme-hao" target="_blank" rel="noopener noreferrer">主题说明</a>
<a href="https://gitea.uptoz.cn/UPToZ/halo-theme-hao/releases" target="_blank" rel="noopener noreferrer">更新说明</a>
3. 建议每次更新主题后重载一次主题配置然后重启Halo以降低旧数据缓存对程序带来的影响。
4. 如果遇到问题解决不了,可以提 <a href="https://gitee.com/uptoz/halo-theme-hao/issues" target="_blank" rel="noopener noreferrer">ISSUE</a>
2. 如果安装主题后报错,请仔细查阅[主题说明](https://gitea.uptoz.cn/UPToZ/halo-theme-hao)
[更新说明](https://gitea.uptoz.cn/UPToZ/halo-theme-hao/releases)
3. 如果还未解决,可以加群求助!!!
4. 如果群友也解决不了再考虑提ISSUE
5. `1.0.0`及以上版本需要`Halo`版本>=`2.14.0`
6. **若安装主题后出现500错误请到主题设置页面将每个设置项都保存一下**
7. 此主题`所有版本`必须使用`本地资源`。
7. **`beta`版本主题必须使用`本地资源`,正式版本才会存在`在线资源`**
### 🔌 插件依赖
@ -46,35 +38,19 @@
> 部分插件可能已经预设在 Halo 内。
> 部分插件主题尚未适配。
- 评论功能 <a href="https://github.com/halo-sigs/plugin-comment-widget/releases" target="_blank" rel="noopener noreferrer">plugin-comment-widget</a>
- 搜索功能 <a href="https://github.com/halo-sigs/plugin-search-widget/releases" target="_blank" rel="noopener noreferrer">plugin-search-widget</a>
- 友链页面 <a href="https://github.com/halo-sigs/plugin-links" target="_blank" rel="noopener noreferrer">plugin-links</a>
- 瞬间页面 <a href="https://github.com/halo-sigs/plugin-moments" target="_blank" rel="noopener noreferrer">plugin-moments</a>
- 追番插件 <a href="https://github.com/Roozenlz/plugin-bilibili-bangumi" target="_blank" rel="noopener noreferrer">plugin-bilibili-bangumi</a>
- 图库插件 <a href="https://github.com/halo-sigs/plugin-photos" target="_blank" rel="noopener noreferrer">plugin-photos</a>
- katex插件 <a href="https://github.com/chengzhongxue/plugin-katex/releases/" target="_blank" rel="noopener noreferrer">plugin-katex</a>
- 我的装备 <a href="https://github.com/chengzhongxue/plugin-equipments" target="_blank" rel="noopener noreferrer">plugin-equipments</a>
- Markdown / HTML 内容块插件 <a href="https://www.halo.run/store/apps/app-NgHnY" target="_blank" rel="noopener noreferrer">plugin-hybrid-edit-block</a>
- 爱发电 <a href="https://www.halo.run/store/apps/app-oXvZp" target="_blank" rel="noopener noreferrer">plugin-afdian</a>
- 评论功能 [plugin-comment-widget](https://github.com/halo-sigs/plugin-comment-widget/releases)
- 搜索功能 [plugin-search-widget](https://github.com/halo-sigs/plugin-search-widget/releases)
- 友链页面 [plugin-links](https://github.com/halo-sigs/plugin-links)
- 瞬间页面 [plugin-moments](https://github.com/halo-sigs/plugin-moments)
- 追番插件 [plugin-bilibili-bangumi](https://github.com/Roozenlz/plugin-bilibili-bangumi)
- 图库插件 [plugin-photos](https://github.com/halo-sigs/plugin-photos)
- katex插件 [plugin-katex](https://github.com/chengzhongxue/plugin-katex/releases/)
- 我的装备 [plugin-equipments](https://github.com/chengzhongxue/plugin-equipments)
- Markdown / HTML 内容块插件 [plugin-hybrid-edit-block](https://www.halo.run/store/apps/app-NgHnY)
- 爱发电 [plugin-afdian](https://www.halo.run/store/apps/app-oXvZp)
> 更多插件请参见https://github.com/halo-sigs/awesome-halo
## 📝 使用
<a href="https://blog.uptoz.cn/docs/hao-ce" target="_blank" rel="noopener noreferrer">Halo-Theme-Hao Document</a>
## 💰 赞助
如果我微调后的 Hao主题 对你有帮助,欢迎<a href="https://afdian.net/a/uptoz" target="_blank" rel="noopener noreferrer">赞助我</a>
### 👍 赞助方式
- **微信**
<img src="https://api.minio.uptoz.cn/blog/images/AAuSxUqDpF.webp" alt="微信赞赏码" style="width: 15%; height: auto;" />
- **支付宝**
<img src="https://api.minio.uptoz.cn/blog/images/LERpOX2ifr.webp" alt="支付宝收款码" style="width: 15%; height: auto;" />
## 🔒 许可
<a href="https://gitea.uptoz.cn/UPToZ/halo-theme-hao" target="_blank" rel="noopener noreferrer">Halo-Theme-Hao</a> 使用 <a href="https://gitea.uptoz.cn/UPToZ/halo-theme-hao/src/branch/main/LICENSE" target="_blank" rel="noopener noreferrer">CC BY-SA 4.0</a> 协议开源,请遵守开源协议。
[点我查看](https://www.yuque.com/liuzhihangs/halo-theme-hao)

View File

@ -29,7 +29,7 @@ spec:
name: gongan
label: 公安备案
placeholder: 请输入公安备案号
help: 格式:公网安备 xxxxxxxx 号
help: 格式:公网安备 xxxxxxxx 号
- $formkit: url
name: copyrightAgreement
label: 版权协议
@ -50,7 +50,7 @@ spec:
- $formkit: radio
name: pc_leftMenu
id: pc_leftMenu
label: PC端左侧菜单
label: pc端左侧菜单
options:
- label: 显示
value: true
@ -58,7 +58,7 @@ spec:
value: false
- $formkit: radio
name: phone_leftMenu
label: 移动左侧菜单
label: 移动左侧菜单
options:
- label: 显示
value: true
@ -66,7 +66,7 @@ spec:
value: false
- $formkit: radio
name: phone_menu
label: 移动主菜单
label: 移动主菜单
options:
- label: 显示
value: true
@ -111,7 +111,7 @@ spec:
- $formkit: radio
name: darkMode
label: 切换模式
help: 右上角切换主题深色/浅色模式按钮
help: 右上角切换主题模式按钮
options:
- label: 显示
value: true
@ -119,8 +119,8 @@ spec:
value: false
- $formkit: radio
name: navLogin
label: 按钮
help: 右上角登按钮
label: 按钮
help: 右上角登按钮
options:
- label: 显示
value: true
@ -310,13 +310,13 @@ spec:
colorTwoLight: "#ffbf37"
colorOneDark: "#e22a16"
colorTwoDark: "#da980c"
- title: "实用教程"
icon: "haofont hao-icon-book"
url: "/"
colorOneLight: "#18e7ae"
colorTwoLight: "#1eebeb"
colorOneDark: "#099e74"
colorTwoDark: "#0ea4a4"
# - title: "实用教程"
# icon: "haofont hao-icon-book"
# url: "/"
# colorOneLight: "#18e7ae"
# colorTwoLight: "#1eebeb"
# colorOneDark: "#099e74"
# colorTwoDark: "#0ea4a4"
techStack:
children:
- $formkit: select

View File

@ -311,7 +311,7 @@ document.addEventListener('scroll', btf.throttle(function () {
//友链随机传送
function travelling() {
function getLinks() {
const links = "/apis/api.plugin.halo.run/v1alpha1/plugins/PluginLinks/links?keyword="
const links = "/apis/api.plugin.halo.run/v1alpha1/plugins/PluginLinks/links?keyword=&sort=priority,asc"
fetch(links)
.then(res => res.json())
.then(json => {

View File

@ -51,8 +51,7 @@
<div class="equipment-item-content-item-toolbar">
<a class="equipment-item-content-item-link" th:href="${#annotations.get(equipment, 'link')}"
target="_blank">[[${#annotations.get(equipment, 'button')}]]</a>
<!-- <a class="bber-reply" -->
<a class="bber-reply" th:if="${theme.config.comments.use != 'commentWidget'}"
<a class="bber-reply"
th:onclick="rightMenuCommentText([['&quot;'+${equipment.spec.displayName}+' '+${#annotations.get(equipment, 'model')}+' '+${equipment.spec.description}+'&quot;']]);"
data-pjax-state="">
<i class="haofont hao-icon-chat--fill" style="font-size: 22px;"></i>
@ -198,7 +197,7 @@
th:replace="~{modules/comment :: comment(group = 'content.halo.run',
kind = 'SinglePage',
name = 'equipment',
allowComment = ${theme.config.comments.use != 'commentWidget'})}"/>
allowComment = true)}"/>
</div>
</main>

View File

@ -20,13 +20,13 @@
<div id="page">
<th:block th:replace="~{macro/content-links :: content-links(${htmlType})}" />
<hr th:if="${theme.config.comments.use != 'commentWidget'}" />
<hr/>
<!--/* 评论组件 */-->
<th:block
th:replace="~{modules/comment :: comment(group = 'content.halo.run',
kind = 'SinglePage',
name = 'links',
allowComment = ${theme.config.comments.use != 'commentWidget'})}"/>
allowComment = true)}"/>
<style>
/*修复友链页面表情选择器无法显示完全的bug*/

View File

@ -4,7 +4,7 @@
<div class="item-headline"><a class="card-more-btn" href="/archives/" title="查看更多" data-pjax-state=""></a></div>
<ul class="card-archive-list"
th:with="archives = ${postFinder.archives(1,0)}, archivesQuantity = ${#conversions.convert(theme.config.sidebar.archivesQuantity, 'java.lang.Integer')}">
th:with="archives = ${postFinder.archives(1,1000)}, archivesQuantity = ${#conversions.convert(theme.config.sidebar.archivesQuantity, 'java.lang.Integer')}">
<th:block th:each="archive,archiveStat : ${archives.items}">
<li class="card-archive-list-item"
th:each="month,monthIndex : ${archive.months}"

View File

@ -1,48 +1,24 @@
<!-- <div class="card-widget card-recent-post card-article" th:with='posts = ${postFinder.list(1,theme.config.sidebar.recentPost)}, -->
<div class="card-widget card-recent-post" th:with='
<div class="card-widget card-recent-post card-article" th:with='posts = ${postFinder.list(1,theme.config.sidebar.recentPost)},
postRandomImg=${#strings.contains(theme.config.layout.postRandomImg,"?") ? theme.config.layout.postRandomImg+"&" : theme.config.layout.postRandomImg+"?"}'>
<div class="item-headline"><i class="haofont hao-icon-eicon_map-2-line1"></i><span>最近发布</span></div>
<div class="aside-list">
<!-- 最新文章,用户可以自定义展示数量 -->
<th:block th:with="archives = ${postFinder.archives(1,#conversions.convert(theme.config.sidebar.recentPost, 'java.lang.Integer'))}">
<th:block th:each="archive : ${archives.items}">
<th:block th:each="month : ${archive.months}">
<div class="aside-list-item" th:each="post : ${month.posts}">
<a class="thumbnail" th:href="@{${post.status.permalink}}" th:title="${post.spec.title}">
<img th:alt="${post.spec.title}"
th:with="img = ${#strings.isEmpty(post.spec.cover) ? postRandomImg+post.spec.title : post.spec.cover}"
<div class="aside-list-item" th:each="post : ${posts}">
<a class="thumbnail" th:href="@{${post.status.permalink}}" th:title="${post.spec.title}">
<img th:alt="${post.spec.title}"
th:with="img = ${#strings.isEmpty(post.spec.cover) ? postRandomImg+post.spec.title : post.spec.cover}"
th:src="${isLazyload ? loadingImg : img}"
th:data-lazy-src="${ isLazyload ? img : ''}">
</a>
<div class="content">
<a class="title" th:href="@{${post.status.permalink}}" th:text="${post.spec.title}" th:title="${post.spec.title}"></a>
<time th:attr="datetime=${#dates.format(post.spec.publishTime, 'yyyy-MM-dd HH:mm:ss')}"
th:text="${#dates.format(post.spec.publishTime,'yyyy-MM-dd HH:mm:ss')}"
th:title="${#dates.format(post.spec.publishTime,'yyyy-MM-dd HH:mm:ss')}">
</time>
</div>
</div>
th:src="${isLazyload ? loadingImg : img}"
th:data-lazy-src="${ isLazyload ? img : ''}">
</a>
<div class="content">
<a class="title" th:href="@{${post.status.permalink}}" th:text="${post.spec.title}" th:title="${post.spec.title}"></a>
<time th:attr="datetime=${#dates.format(post.spec.publishTime, 'yyyy-MM-dd HH:mm:ss')}"
th:text="${#dates.format(post.spec.publishTime,'yyyy-MM-dd HH:mm:ss')}"
th:title="${#dates.format(post.spec.publishTime,'yyyy-MM-dd HH:mm:ss')}">
</time>
</div>
</div>
</th:block>
</th:block>
</th:block>
<!-- 以下代码会将置顶的文章也显示在最近发布 -->
<!-- <div class="aside-list-item" th:each="post : ${posts}">
<a class="thumbnail" th:href="@{${post.status.permalink}}" th:title="${post.spec.title}">
<img th:alt="${post.spec.title}"
th:with="img = ${#strings.isEmpty(post.spec.cover) ? postRandomImg+post.spec.title : post.spec.cover}"
th:src="${isLazyload ? loadingImg : img}"
th:data-lazy-src="${ isLazyload ? img : ''}">
</a>
<div class="content">
<a class="title" th:href="@{${post.status.permalink}}" th:text="${post.spec.title}" th:title="${post.spec.title}"></a>
<time th:attr="datetime=${#dates.format(post.spec.publishTime, 'yyyy-MM-dd HH:mm:ss')}"
th:text="${#dates.format(post.spec.publishTime,'yyyy-MM-dd HH:mm:ss')}"
th:title="${#dates.format(post.spec.publishTime,'yyyy-MM-dd HH:mm:ss')}">
</time>
</div>
</div> -->
</div>
</div>

View File

@ -62,7 +62,7 @@
<!-- 底部展示时间归档 -->
<div class="console-card history" onclick="heo.hideConsole()">
<div class="item-headline"><i class="fas fa-archive"></i><span>文章</span></div>
<ul class="card-archive-list" th:with="archives = ${postFinder.archives(1,0)}">
<ul class="card-archive-list" th:with="archives = ${postFinder.archives(1,1000)}">
<th:block th:each="archive : ${archives.items}">
<li class="card-archive-list-item" th:each="month,monthStat : ${archive.months}">
<a class="card-archive-list-link" th:href="@{'/archives/'+${archive.year}+'/'+${month.month}}"

View File

@ -59,9 +59,7 @@
th:text="${#dates.format(moment.spec.releaseTime,'yyyy-MM-dd')}"></time>
</div>
</div>
<!-- <a class="bber-reply" th:onclick="rightMenuCommentText([[${content.html}]]);" -->
<a class="bber-reply" th:if="${theme.config.comments.use != 'commentWidget'}"
th:onclick="rightMenuCommentText([[${content.html}]]);"
<a class="bber-reply" th:onclick="rightMenuCommentText([[${content.html}]]);"
data-pjax-state=""> <i class="haofont hao-icon-chat--fill"
style="font-size: 20px;"></i>
</a>
@ -73,12 +71,12 @@
</div>
<div id="bber-tips" style="color: var(--heo-secondtext);">- 只展示最近30条短文 -</div>
<script>heo.reflashEssayWaterFall();</script>
<hr th:if="${theme.config.comments.use != 'commentWidget'}" />
<hr />
<!--/* 评论组件 */-->
<th:block th:replace="~{modules/comment :: comment(group = 'content.halo.run',
kind = 'SinglePage',
name = 'moments',
allowComment = ${theme.config.comments.use != 'commentWidget'})}" />
allowComment = true)}" />
</div>

View File

@ -49,11 +49,7 @@ spec:
logo: /themes/theme-hao/assets/images/hao-logo.jpg
website: https://blog.uptoz.cn
repo: https://gitea.uptoz.cn/UPToZ/halo-theme-hao
issues: https://gitee.com/uptoz/halo-theme-hao/issues
settingName: "theme-hao-setting"
configMapName: "theme-hao-configMap"
version: "1.0.3-ce"
require: ">=2.15.0"
license:
- name: "CC BY-SA 4.0"
url: "https://gitee.com/uptoz/halo-theme-hao/blob/main/LICENSE"
version: "1.0.2-ce"
require: ">=2.10.0"