Revert "修复最新评论,文章摘要,优化上下页阅读建议"

This commit is contained in:
小孙同学 2023-06-30 08:59:44 +08:00 committed by GitHub
parent ee360c9554
commit 8fd9c61094
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 140 additions and 232 deletions

View File

@ -661,16 +661,6 @@ spec:
- label: 关闭
value: false
help: "文章主色匹配图片颜色"
- $formkit: radio
name: summarize
label: 文章摘要
value: false
options:
- label: 打开
value: true
- label: 关闭
value: false
help: "是否显示文章摘要"
- $formkit: number
name: recommendQuantity
label: 阅读建议
@ -1328,11 +1318,6 @@ spec:
label: Twikoo评论-mailMd5
placeholder: 请输入mailMd5
help: 注意格式 (`mailMd5`)
- $formkit: number
name: newcommentnumber
label: 评论数量
value: 5
help: "最新评论数量"
- group: other
label: 其他设置
formSchema:

View File

@ -3163,7 +3163,6 @@ ul {
opacity: 0.4;
transition: all 0.6s ease 0s;
object-fit: cover;
color: white;
}
#pagination .pagination-info {
@ -3216,14 +3215,6 @@ ul {
height: 150px;
}
#pagination .next-post2 a,
#pagination .prev-post2 a {
position: relative;
display: block;
overflow: hidden;
height: 150px;
}
#pagination .next-post:hover img.next-cover,
#pagination .next-post:hover img.prev-cover,
#pagination .prev-post:hover img.next-cover,
@ -9005,10 +8996,10 @@ li {
display: -webkit-box;
overflow: hidden;
-webkit-box-orient: vertical;
-webkit-line-clamp: 1;
-webkit-line-clamp: 2;
line-height: 1.4;
color: var(--heo-secondtext);
margin-top: 0.4rem;
margin-top: 0.5rem;
}
@media screen and (max-width: 1300px) {
@ -12436,46 +12427,7 @@ a.reward-main-btn:hover {
.prev-post.pull-left,
#pagination .prev-post,
#pagination .next-post {
background: #363636;
}
.next-post2.pull-right,
.prev-post2.pull-left,
#pagination .prev-post2,
#pagination .next-post2 {
background: #363636;
}
#preimg{
position: absolute;
width: 100%;
height: 100%;
opacity: .4;
-webkit-transition: all .6s,filter 375ms ease-in .2s;
-moz-transition: all .6s,filter 375ms ease-in .2s;
-o-transition: all .6s,filter 375ms ease-in .2s;
-ms-transition: all .6s,filter 375ms ease-in .2s;
transition: all .6s,filter 375ms ease-in .2s;
object-fit: cover;
border-radius: 0;
}
.prev-post2.pull-left:hover #preimg {
opacity: 1;
transform: scale(1.1);
}
.prev-post.pull-left:hover #preimg {
opacity: 1;
transform: scale(1.1);
}
.next-post.pull-right:hover #preimg {
opacity: 1;
transform: scale(1.1);
}
.next-post2.pull-right:hover #preimg {
opacity: 1;
transform: scale(1.1);
background: var(--heo-secondbg);
}
@media screen and (min-width: 768px) {
@ -12552,17 +12504,12 @@ a.reward-main-btn:hover {
#post #pagination .prev-post .label,
#pagination .next-post .label {
color: white;
}
#post #pagination .prev-post2 .label,
#pagination .next-post2 .label {
color: white;
color: var(--heo-fontcolor);
}
#post #pagination .prev_info,
#pagination .next_info {
color: white;
color: var(--heo-fontcolor);
font-weight: bold;
-webkit-line-clamp: 2;
white-space: normal;
@ -12870,15 +12817,14 @@ a.reward-main-btn:hover {
}
.relatedPosts > .relatedPosts-list > div {
background: #363636;
background: var(--heo-background);
transition: 0.3s;
cursor: pointer;
overflow: hidden;
}
.relatedPosts > .relatedPosts-list > div:hover #preimg{
opacity: 1;
transform: scale(1.1);
.relatedPosts > .relatedPosts-list > div:hover {
background: var(--heo-main);
}
@media screen and (max-width: 768px) {
@ -12907,11 +12853,12 @@ a.reward-main-btn:hover {
line-height: 1.5;
-webkit-line-clamp: 4;
font-size: 0.9rem;
text-align: center;
text-align: left;
}
.relatedPosts > .relatedPosts-list .content .date {
color: var(--heo-fontcolor);
display: none;
}
/* 分割线 */
@ -17428,7 +17375,3 @@ a.toc-link {
#nav .menus_items .menus_item .menus_item_child li a:hover {
padding: 0.2rem 0.5rem;
}
.postcarnepre{
width: 100%;
}

View File

@ -39,7 +39,7 @@
th:href="@{${post.status.permalink}}"
th:text="${post.spec.title}">
</a>
<div class="content" th:if="${theme.config.post.summarize}" th:text="${post.status.excerpt}"></div>
<div class="content" th:text="${post.status.excerpt}"></div>
</div>

View File

@ -3,39 +3,23 @@
<!-- 归档 -->
<div class="card-widget card-recent-post" th:fragment="comments">
<div class="item-headline"><i class="iconfont icon-comment-dots"></i><span>最新评论</span></div>
<div class="aside-list" id="newcomm">
<div class="aside-list">
</div>
</div>
<script th:src="@{/assets/libs/twikoo/twikoo.all.min.js}"></script>
<script th:if="${theme.config.comments.twikoo && #strings.equals(theme.config.comments.use, 'Twikoo') && not #strings.isEmpty(theme.config.comments.envId)}">
twikoo.getRecentComments({
envId: [[${ theme.config.comments.envId }]], // 环境 ID
// region: 'ap-guangzhou', // 环境地域,默认为 ap-shanghai如果您的环境地域不是上海需传此参数
pageSize: [[${theme.config.comments.newcommentnumber}]], // 获取多少条默认10最大100
includeReply: false // 是否包括最新回复默认false
}).then(function (res) {
let commenthtml = '';
res.forEach((items)=>{
commenthtml += `<div class="aside-list-item">
<a class="thumbnail" href="${items.url}">
<img loading="lazy" alt="dasda" src="${items.avatar}">
<div class="aside-list-item">
<a class="thumbnail" href="/404.html">
<img loading="lazy" alt="dasda" src="https://seccdn.libravatar.org/avatar/7d88658473effdd6b068e181b9636878?d=robohash">
</a>
<div class="content">
<a class="comment" style="display: -webkit-box;-webkit-line-clamp: 2;-webkit-box-orient: vertical;overflow: hidden;" href="${items.url}" title="test">
${items.commentText}
<a class="comment" href="/messageboard/#635ba6370ccf12000f30a175" title="test">
评论模块未完成
</a>
<div class="name">
<span>${items.nick} / </span>
<time datetime="${items.created}">${items.relativeTime}</time>
<span>liuzhihang / </span>
<time datetime="2022-10-28T09:51:51.581Z">20 小時前</time>
</div>
</div>
</div>`
});
document.querySelector('#newcomm').innerHTML = commenthtml;
}).catch(function (err) {
// 发生错误
console.error(err);
});
</script>
</div>
</div>
</div>
</html>

View File

@ -541,20 +541,16 @@
</div>
<nav class="pagination-post" id="pagination"
th:with="postCursor = ${postFinder.cursor(post.metadata.name)}">
<div th:class="${postCursor.hasPrevious()==true && postCursor.hasNext()==false} ? 'prev-post2 pull-left postcarnepre' : 'prev-post pull-left'">
<div class="prev-post pull-left">
<a th:if="${postCursor.hasPrevious()}" th:href="@{${postCursor.previous.status.permalink}}">
<img alt="cover" id="preimg" class="nolazyload"
th:src="${#strings.isEmpty(postCursor.previous.spec.cover) ? theme.config.layout.postRandomImg : postCursor.previous.spec.cover}">
<div class="pagination-info">
<div class="label">上一篇</div>
<div class="prev_info" th:text="${postCursor.previous.spec.title}"></div>
</div>
</a>
</div>
<div th:class="${postCursor.hasPrevious()==false && postCursor.hasNext()==true} ? 'next-post2 pull-right postcarnepre':'next-post pull-right'">
<div class="next-post pull-right">
<a th:if="${postCursor.hasNext()}" th:href="@{${postCursor.next.status.permalink}}">
<img alt="cover" id="preimg" class="nolazyload"
th:src="${#strings.isEmpty(postCursor.next.spec.cover) ? theme.config.layout.postRandomImg : postCursor.next.spec.cover}">
<div class="pagination-info">
<div class="label">下一篇</div>
<div class="next_info" th:text="${postCursor.next.spec.title}"></div>
@ -573,13 +569,13 @@
<!-- 建议阅读,这里可以自定义文章数量,然后遍历展示 -->
<div th:each="recommandPost :${recommandPosts}">
<a th:href="@{${recommandPost.status.permalink}}" th:title="${recommandPost.spec.title}">
<img alt="cover" class="cover" loading="lazy" id="preimg"
th:src="${#strings.isEmpty(recommandPost.spec.cover) ? theme.config.layout.postRandomImg : recommandPost.spec.cover}">
<div class="content is-center" >
<div class="date" style="color: white"><i class="far fa-calendar-alt fa-fw"></i>
<img alt="cover" class="cover" loading="lazy"
th:src="${#strings.isEmpty(recommandPost.spec.cover) ? theme.config.layout.postRandomImg : recommandPost.spec.cover}">
<div class="content is-center">
<div class="date"><i class="far fa-calendar-alt fa-fw"></i>
[[${#dates.format(recommandPost.spec.publishTime,'yyyy-MM-dd HH:mm:ss')}]]
</div>
<div class="title" style="color: white" th:text="${recommandPost.spec.title}"></div>
<div class="title" th:text="${recommandPost.spec.title}"></div>
</div>
</a>
</div>