Skip to content

Commit

Permalink
适配朋友圈1.3.4
Browse files Browse the repository at this point in the history
  • Loading branch information
mjsoftking committed Sep 10, 2024
1 parent 4fe96ad commit 2a1fe6b
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 39 deletions.
9 changes: 0 additions & 9 deletions settings.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -1090,15 +1090,6 @@ spec:
name: journals_share_image
label: 瞬间页面-瞬间分享背景图
placeholder: '请输入/选择图片路径'
- $formkit: radio
name: enable_friends_stats
label: 朋友圈页面-开启朋友圈统计信息显示
value: true
options:
- value: true
label: 开启
- value: false
label: 关闭
- $formkit: group
name: search
label: 搜索页面
Expand Down
29 changes: 2 additions & 27 deletions templates/friends.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,38 +4,13 @@
th:with="isJournals = true, enableShare = false, baseEnableComment = false"
xmlns:th="https://www.thymeleaf.org">
<th:block th:fragment="content">
<div th:if="${theme.config.page_config.enable_friends_stats}" class="card card-content friends">
<div class="card-tab">
<div>[[${#strings.replace(title, ' - ' + site.title, '')}]]</div>
</div>
<nav class="level">
<div class="level-item">
<div>
<p class="heading">订阅数</p>
<p class="value" th:title="${statistical.friendsNum}" th:text="${statistical.friendsNum}"></p>
</div>
</div>
<div class="level-item">
<div>
<p class="heading">订阅成功数</p>
<p class="value" th:title="${statistical.activeNum}" th:text="${statistical.activeNum}"></p>
</div>
</div>
<div class="level-item">
<div>
<p class="heading">订阅文章数</p>
<p class="value" th:title="${statistical.articleNum}" th:text="${statistical.articleNum}"></p>
</div>
</div>
</nav>
</div>
<div class="widget card friends" th:each="friend : ${friends.items}" th:with="spec = ${friend.spec}">
<div class="card-content main">
<h2 class="title"><a th:href="${spec.link}" target="_blank" th:text="${spec.title}"></a></h2>
<h2 class="title"><a th:href="${spec.postLink}" target="_blank" th:text="${spec.title}"></a></h2>
<div class="main-content not-toc" th:text="${spec.description}"></div>
<hr/>
<div class="meta">
<a class="has-link-grey" th:href="${spec.url}" target="_blank">
<a class="has-link-grey" th:href="${spec.authorUrl}" target="_blank">
<img th:if="${!#strings.isEmpty(spec.logo)}" th:src="${spec.logo}" alt="avatar">
<span th:text="${spec.author}"></span>
</a>
Expand Down
2 changes: 1 addition & 1 deletion templates/main/article.html
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<th:block xmlns:th="https://www.thymeleaf.org"
th:fragment="article (post, type)"
th:with="updateInterval = ${T(java.lang.Math).floor((#dates.createNow().getTime()/1000.0 - post.status.lastModifyTime.getEpochSecond())/86400.0).intValue()},
thumbnail = ${#strings.isEmpty(post.spec.cover) ? #strings.isEmpty(theme.config.post.default_thumbnail) ? '' : theme.config.post.default_thumbnail + (#strings.contains(theme.config.post.default_thumbnail, '?') ? '&' : '?') + 'id=' + post.metadata.name : thumbnail.gen(post.spec.cover, 'm')}">
thumbnail = ${#strings.isEmpty(post.spec.cover) ? #strings.isEmpty(theme.config.post.default_thumbnail) ? '' : theme.config.post.default_thumbnail + (#strings.contains(theme.config.post.default_thumbnail, '?') ? '&' : '?') + 'id=' + post.metadata.name : thumbnail.gen(post.spec.cover, 'l')}">

<div th:if="${!#strings.isEmpty(thumbnail)}" class="card widget">
<div class="cover-image" th:style="'background-image: url(' + ${thumbnail} + ')'">
Expand Down
2 changes: 1 addition & 1 deletion templates/main/article_list.html
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<th:block xmlns:th="https://www.thymeleaf.org"
th:fragment="articleList (posts)">
<th:block th:each="post : ${posts}"
th:with="thumbnail = ${#strings.isEmpty(post.spec.cover) ? #strings.isEmpty(theme.config.post.default_thumbnail) ? '' : theme.config.post.default_thumbnail + (#strings.contains(theme.config.post.default_thumbnail, '?') ? '&' : '?') + 'id=' + post.metadata.name : thumbnail.gen(post.spec.cover, 's')},
th:with="thumbnail = ${#strings.isEmpty(post.spec.cover) ? #strings.isEmpty(theme.config.post.default_thumbnail) ? '' : theme.config.post.default_thumbnail + (#strings.contains(theme.config.post.default_thumbnail, '?') ? '&' : '?') + 'id=' + post.metadata.name : thumbnail.gen(post.spec.cover, 'l')},
thumbnail_mode = ${(theme.config.post.top_thumbnail_mode == 'grid' || (!post.spec.pinned && theme.config.post.thumbnail_mode == 'grid'))? 'grid' : (!#strings.isEmpty(post.metadata.annotations.get('thumbnail_mode')) && post.metadata.annotations.get('thumbnail_mode') != 'none')? post.metadata.annotations.get('thumbnail_mode') : post.spec.pinned ? theme.config.post.top_thumbnail_mode : theme.config.post.thumbnail_mode}">
<div th:if="${!#strings.isEmpty(thumbnail) && thumbnail_mode == 'back'}" class="card widget card-cover">
<a th:href="${post.status.permalink}">
Expand Down
2 changes: 1 addition & 1 deletion theme.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ spec:
settingName: theme-dream2-plus-setting
configMapName: theme-dream2-plus-configMap
# 版本号
version: 1.2.9
version: 1.2.9.beta1
# 最低支持的 Halo 版本
require: ">=2.19.0"
# 许可
Expand Down

0 comments on commit 2a1fe6b

Please sign in to comment.