Skip to content

Commit

Permalink
修复链接管理升级到1.4.0导致的bug
Browse files Browse the repository at this point in the history
修复侧边栏最新文章显示与置顶文章冲突
修复其他bug
  • Loading branch information
chengzhongxue committed Jun 20, 2024
1 parent 89d185e commit ec57874
Show file tree
Hide file tree
Showing 7 changed files with 28 additions and 23 deletions.
2 changes: 1 addition & 1 deletion templates/assets/js/heo.js
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ var heo = {
footerRandomFriendsBtn.style.transitionDuration = "0.3s";
footerRandomFriendsBtn.style.transform = "rotate(" + 360 * refreshNum++ + "deg)";
function getLinks(){
const fetchUrl = "/apis/api.plugin.halo.run/v1alpha1/plugins/PluginLinks/links?keyword=&sort=priority,asc"
const fetchUrl = "/apis/api.plugin.halo.run/v1alpha1/plugins/PluginLinks/links?keyword="
fetch(fetchUrl)
.then(res => res.json())
.then(json => {
Expand Down
2 changes: 1 addition & 1 deletion templates/assets/zhheo/blogex.js
Original file line number Diff line number Diff line change
Expand Up @@ -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=&sort=priority,asc"
const links = "/apis/api.plugin.halo.run/v1alpha1/plugins/PluginLinks/links?keyword="
fetch(links)
.then(res => res.json())
.then(json => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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,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}">
<li class="card-archive-list-item"
th:each="month,monthIndex : ${archive.months}"
Expand Down
39 changes: 22 additions & 17 deletions templates/modules/widgets/aside/recent-posts.html
Original file line number Diff line number Diff line change
@@ -1,24 +1,29 @@
<div class="card-widget card-recent-post" 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+"?"}'>
<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-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: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}"

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>
</div>
2 changes: 1 addition & 1 deletion templates/modules/widgets/console.html
Original file line number Diff line number Diff line change
Expand Up @@ -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,1000)}">
<ul class="card-archive-list" th:with="archives = ${postFinder.archives(1,0)}">
<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}}"
Expand Down
2 changes: 1 addition & 1 deletion templates/new_comment.html
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
<div class="comment-card" th:title="${comment.spec.content}"
th:onclick="pjax.loadUrl([[${url}]])">
<div class="comment-info">
<img th:with=" img =${#strings.isEmpty(comment.owner.avatar)?'https://cravatar.cn/avatar/?d=mp':comment.owner.avatar}"
<img th:with=" img =${#strings.isEmpty(comment.owner.avatar)? theme.config.sidebar.newcomment.providerMirror+'/avatar/'+comment.spec.owner.annotations['email-hash'] :comment.owner.avatar}"
th:alt="${comment.owner.displayName}" th:src="${isLazyload ? loadingImg : img}"
th:data-lazy-src="${ isLazyload ? img : ''}" class="no-lightbox nolazyload avatar">
<div class="comment-information">
Expand Down
2 changes: 1 addition & 1 deletion theme.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -45,5 +45,5 @@ spec:
repo: https://github.com/chengzhongxue/halo-theme-hao
settingName: "theme-hao-setting"
configMapName: "theme-hao-configMap"
version: "1.5.2"
version: "1.5.3"
require: ">=2.15.0"

0 comments on commit ec57874

Please sign in to comment.