Compare commits

...

5 Commits
main ... dev

Author SHA1 Message Date
ab1ccd77c9 Merge branch 'dev' of https://gitea.uptoz.cn/UPToZ/halo-theme-hao into dev 2024-06-26 00:44:28 +08:00
d9cfa019d4 更新主题说明和主题配置 2024-06-26 00:37:47 +08:00
b9a3c03052 更新主题说明和主题配置 2024-06-26 00:06:43 +08:00
536ca878c1 更新项目描述 2024-06-21 22:35:12 +08:00
9bca332716 修复侧边栏最近发布模块显示与置顶文章冲突的问题
detailed:
1.更新主题版本号为1.0.3-ce。
2.更新主题最低Halo版本要求为>=2.15.0。
3.增加主题问题反馈地址。
4.增加主题协议。
5.修复侧边栏最近发布模块一直显示置顶文章的问题。
2024-06-21 01:03:20 +08:00
10 changed files with 122 additions and 67 deletions

View File

@ -1,36 +1,44 @@
<div align="center"> <div align="center">
<!-- 主题Logo --> <!-- 主题Logo -->
<img width="100px" src="https://api.minio.yyds.pink/moony/files/2024/04/halo-theme-hao-sbxqdmuv.png"> <img width="100px" src="https://api.minio.uptoz.cn/blog/images/d1oghFBTxV.webp">
<!-- 主题名称 --> <!-- 主题名称 -->
<h1>Halo-Theme-Hao</h1> <h1>Halo-Theme-Hao</h1>
</div> </div>
<!-- 主题预览图 -->
![](https://api.minio.uptoz.cn/blog/images/NsUInjCbZN.webp)
## 🔥 预览 ## 🔥 预览
| 站点名称 | 站点地址 | | 站点名称 | 站点地址 |
|:--------------:|:------------------------:| |:-------------:|:----------------:|
| 小小笔记大大用处 | https://blog.uptoz.cn | | 小小笔记大大用处 | https://blog.uptoz.cn |
## 👋 简介 ## 👋 简介
[Halo-Theme-Hao](https://gitea.uptoz.cn/UPToZ/halo-theme-hao) <a href="https://gitea.uptoz.cn/UPToZ/halo-theme-hao/" target="_blank" rel="noopener noreferrer">Halo-Theme-Hao</a>
是一款适用于 [Halo2.x](https://github.com/halo-dev/halo) 的博客主题。 是一款适用于 <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到我个人仓库并进行了微调。
移植自 [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. **建站时间必填** 1. **建站时间必填**
2. 如果安装主题后报错,请仔细查阅[主题说明](https://gitea.uptoz.cn/UPToZ/halo-theme-hao) 2. 如果安装主题后报错,请仔细查阅<a href="https://gitea.uptoz.cn/UPToZ/halo-theme-hao" target="_blank" rel="noopener noreferrer">主题说明</a>
[更新说明](https://gitea.uptoz.cn/UPToZ/halo-theme-hao/releases) <a href="https://gitea.uptoz.cn/UPToZ/halo-theme-hao/releases" target="_blank" rel="noopener noreferrer">更新说明</a>
3. 如果还未解决,可以加群求助!!! 3. 建议每次更新主题后重载一次主题配置然后重启Halo以降低旧数据缓存对程序带来的影响。
4. 如果群友也解决不了再考虑提ISSUE 4. 如果遇到问题解决不了,可以提 <a href="https://gitee.com/uptoz/halo-theme-hao/issues" target="_blank" rel="noopener noreferrer">ISSUE</a>
5. `1.0.0`及以上版本需要`Halo`版本>=`2.14.0` 5. `1.0.0`及以上版本需要`Halo`版本>=`2.14.0`
6. **若安装主题后出现500错误请到主题设置页面将每个设置项都保存一下** 6. **若安装主题后出现500错误请到主题设置页面将每个设置项都保存一下**
7. **`beta`版本主题必须使用`本地资源`,正式版本才会存在`在线资源`** 7. 此主题`所有版本`必须使用`本地资源`。
### 🔌 插件依赖 ### 🔌 插件依赖
@ -38,19 +46,35 @@
> 部分插件可能已经预设在 Halo 内。 > 部分插件可能已经预设在 Halo 内。
> 部分插件主题尚未适配。 > 部分插件主题尚未适配。
- 评论功能 [plugin-comment-widget](https://github.com/halo-sigs/plugin-comment-widget/releases) - 评论功能 <a href="https://github.com/halo-sigs/plugin-comment-widget/releases" target="_blank" rel="noopener noreferrer">plugin-comment-widget</a>
- 搜索功能 [plugin-search-widget](https://github.com/halo-sigs/plugin-search-widget/releases) - 搜索功能 <a href="https://github.com/halo-sigs/plugin-search-widget/releases" target="_blank" rel="noopener noreferrer">plugin-search-widget</a>
- 友链页面 [plugin-links](https://github.com/halo-sigs/plugin-links) - 友链页面 <a href="https://github.com/halo-sigs/plugin-links" target="_blank" rel="noopener noreferrer">plugin-links</a>
- 瞬间页面 [plugin-moments](https://github.com/halo-sigs/plugin-moments) - 瞬间页面 <a href="https://github.com/halo-sigs/plugin-moments" target="_blank" rel="noopener noreferrer">plugin-moments</a>
- 追番插件 [plugin-bilibili-bangumi](https://github.com/Roozenlz/plugin-bilibili-bangumi) - 追番插件 <a href="https://github.com/Roozenlz/plugin-bilibili-bangumi" target="_blank" rel="noopener noreferrer">plugin-bilibili-bangumi</a>
- 图库插件 [plugin-photos](https://github.com/halo-sigs/plugin-photos) - 图库插件 <a href="https://github.com/halo-sigs/plugin-photos" target="_blank" rel="noopener noreferrer">plugin-photos</a>
- katex插件 [plugin-katex](https://github.com/chengzhongxue/plugin-katex/releases/) - katex插件 <a href="https://github.com/chengzhongxue/plugin-katex/releases/" target="_blank" rel="noopener noreferrer">plugin-katex</a>
- 我的装备 [plugin-equipments](https://github.com/chengzhongxue/plugin-equipments) - 我的装备 <a href="https://github.com/chengzhongxue/plugin-equipments" target="_blank" rel="noopener noreferrer">plugin-equipments</a>
- Markdown / HTML 内容块插件 [plugin-hybrid-edit-block](https://www.halo.run/store/apps/app-NgHnY) - Markdown / HTML 内容块插件 <a href="https://www.halo.run/store/apps/app-NgHnY" target="_blank" rel="noopener noreferrer">plugin-hybrid-edit-block</a>
- 爱发电 [plugin-afdian](https://www.halo.run/store/apps/app-oXvZp) - 爱发电 <a href="https://www.halo.run/store/apps/app-oXvZp" target="_blank" rel="noopener noreferrer">plugin-afdian</a>
> 更多插件请参见https://github.com/halo-sigs/awesome-halo > 更多插件请参见https://github.com/halo-sigs/awesome-halo
## 📝 使用 ## 📝 使用
[点我查看](https://www.yuque.com/liuzhihangs/halo-theme-hao) <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> 协议开源,请遵守开源协议。

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -1,9 +1,13 @@
<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 card-article" th:with='posts = ${postFinder.list(1,theme.config.sidebar.recentPost)}, -->
<div class="card-widget card-recent-post" th:with='
postRandomImg=${#strings.contains(theme.config.layout.postRandomImg,"?") ? theme.config.layout.postRandomImg+"&" : theme.config.layout.postRandomImg+"?"}'> 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="item-headline"><i class="haofont hao-icon-eicon_map-2-line1"></i><span>最近发布</span></div>
<div class="aside-list"> <div class="aside-list">
<!-- 最新文章,用户可以自定义展示数量 --> <!-- 最新文章,用户可以自定义展示数量 -->
<div class="aside-list-item" th:each="post : ${posts}"> <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}"> <a class="thumbnail" th:href="@{${post.status.permalink}}" th:title="${post.spec.title}">
<img th:alt="${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:with="img = ${#strings.isEmpty(post.spec.cover) ? postRandomImg+post.spec.title : post.spec.cover}"
@ -19,6 +23,26 @@
</time> </time>
</div> </div>
</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>
</div> </div>

View File

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

View File

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

View File

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