feat(friends): 适配朋友圈插件 (#97)

* feat: 适配朋友圈插件

* feat: 适配朋友圈插件

* feat: 适配朋友圈插件

* feat: 适配朋友圈插件

* feat: 适配朋友圈插件

* feat: 适配朋友圈插件

* feat: 适配朋友圈插件

* feat: 适配朋友圈插件,支持统计显示与隐藏

* feat: 适配朋友圈插件,支持统计显示与隐藏

* feat: 适配朋友圈插件,支持统计显示与隐藏

* feat: 适配朋友圈插件,支持统计显示与隐藏

* fix:修复配置外置地址末尾携带“/”时,在文章版权处显示“//”的问题

* fix:修复配置外置地址末尾携带“/”时,在文章版权处显示“//”的问题
This commit is contained in:
mjking 2024-01-22 09:55:33 +08:00 committed by GitHub
parent 9771b42c37
commit ae30a3b1f5
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
5 changed files with 148 additions and 4 deletions

View File

@ -922,6 +922,15 @@ spec:
name: journals_share_image name: journals_share_image
label: 瞬间页面-瞬间分享背景图 label: 瞬间页面-瞬间分享背景图
placeholder: '请输入/选择图片路径' placeholder: '请输入/选择图片路径'
- $formkit: radio
name: enable_friends_stats
label: 朋友圈页面-开启朋友圈统计信息显示
value: true
options:
- value: true
label: 开启
- value: false
label: 关闭
- group: enhance - group: enhance
label: '增强功能' label: '增强功能'
formSchema: formSchema:

View File

@ -4942,3 +4942,85 @@ button.swiper-pagination-bullet {
} }
} }
} }
/* 朋友圈界面 */
.friends {
.level {
display: flex;
&-item {
flex: 1;
margin: 0 !important;
text-align: center !important;
.heading {
display: block;
letter-spacing: 1px;
margin-bottom: 5px;
text-transform: uppercase;
}
.value {
color: var(--dark-c);
font-size: 2rem;
line-height: 1.125;
margin-bottom: 0;
font-weight: 400 !important;
}
}
&:not(:first-child):not(:empty) {
margin-top: 1.5rem;
}
.button i {
font-size: 16px;
}
}
&-title {
font-size: 1.6rem;
}
&-content {
.description {
margin: 10px 0;
}
}
&-date {
color: var(--dark-c);
display: flex;
align-items: center;
a {
display: flex;
img {
height: 20px;
width: 20px;
}
span {
margin: auto 5px;
}
}
em {
margin-left: auto;
}
}
}
/* 朋友圈界面 - 隐藏统计*/
.friends-hide-stats {
padding: .6rem 1rem 0rem !important;
& > div {
border-bottom: 0px !important;
}
}

File diff suppressed because one or more lines are too long

53
templates/friends.html Normal file
View File

@ -0,0 +1,53 @@
<!DOCTYPE html>
<th:block
th:insert="~{common/layout :: layout (title = ${title} + ' - ' + ${site.title}, canonical = @{/friends}, content = ~{::content}, isPost = true)}"
th:with="isJournals = true, enableShare = false, baseEnableComment = false"
xmlns:th="https://www.thymeleaf.org">
<th:block th:fragment="content">
<div th:class="${theme.config.page_config.enable_friends_stats} ? 'card card-content friends' : 'card card-content friends-hide-stats'">
<div class="card-tab">
<div>[[${#strings.replace(title, ' - ' + site.title, '')}]]</div>
</div>
<nav class="level" th:if="${theme.config.page_config.enable_friends_stats}" th:with="stats = ${friendFinder.statistical()}">
<div class="level-item">
<div>
<p class="heading">订阅数</p>
<p class="value" th:title="${stats.friendsNum}" th:text="${stats.friendsNum}"></p>
</div>
</div>
<div class="level-item">
<div>
<p class="heading">订阅成功数</p>
<p class="value" th:title="${stats.activeNum}" th:text="${stats.activeNum}"></p>
</div>
</div>
<div class="level-item">
<div>
<p class="heading">订阅文章数</p>
<p class="value" th:title="${stats.articleNum}" th:text="${stats.articleNum}"></p>
</div>
</div>
</nav>
</div>
<div class="card card-content friends" th:each="friend : ${friends.items}" th:with="spec = ${friend.spec}">
<p class="friends-title">
<a th:href="${spec.link}" target="_blank">
<span th:text="${spec.title}"></span>
</a>
</p>
<div class="friends-content fold">
<div class="main-content not-toc description">
<span th:text="${spec.description}"></span>
</div>
</div>
<div class="friends-date">
<a th:href="${spec.url}" target="_blank">
<img th:src="${spec.logo}" alt="avatar">
<span th:text="${spec.author}"></span>
</a>
<em th:text="'发表于 ' + ${#dates.format(spec.pubDate,'yyyy年MM月dd日 HH:mm:ss')}"></em>
</div>
</div>
<th:block th:replace="~{main/pagination :: pagination (${friends}, '/friends')}"/>
</th:block>
</th:block>

View File

@ -1,7 +1,7 @@
<div xmlns:th="https://www.thymeleaf.org" class="copyright"> <div xmlns:th="https://www.thymeleaf.org" class="copyright">
<div class="copyright-title"> <div class="copyright-title">
<p th:text="${post.spec.title}"></p> <p th:text="${post.spec.title}"></p>
<a th:href="${post.status.permalink}" th:text="${(#strings.startsWith(post.status.permalink, '/')? site.url : '') + post.status.permalink}"></a> <a th:href="${post.status.permalink}" th:text="${(#strings.startsWith(post.status.permalink, '/')? (#strings.endsWith(site.url, '/') ? #strings.substring(site.url, 0, #strings.length(site.url) - 1) : site.url) : '') + post.status.permalink}"></a>
</div> </div>
<div class="copyright-meta level"> <div class="copyright-meta level">
<div class="level-item"> <div class="level-item">