Fix:最新评论
Fix:优化上一页下一页 阅读建议 Fix:修复文章摘要显示错位 Feat:限制文章摘要是否显示
This commit is contained in:
parent
0c8cc92804
commit
36dc67efcd
|
@ -661,6 +661,16 @@ 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: 阅读建议
|
||||
|
@ -1388,6 +1398,11 @@ spec:
|
|||
label: Twikoo评论-mailMd5
|
||||
placeholder: 请输入mailMd5
|
||||
help: 注意格式 (`mailMd5`)
|
||||
- $formkit: number
|
||||
name: newcommentnumber
|
||||
label: 评论数量
|
||||
value: 5
|
||||
help: "最新评论数量"
|
||||
- group: other
|
||||
label: 其他设置
|
||||
formSchema:
|
||||
|
|
|
@ -3215,6 +3215,14 @@ 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,
|
||||
|
@ -8997,10 +9005,10 @@ li {
|
|||
display: -webkit-box;
|
||||
overflow: hidden;
|
||||
-webkit-box-orient: vertical;
|
||||
-webkit-line-clamp: 2;
|
||||
-webkit-line-clamp: 1;
|
||||
line-height: 1.4;
|
||||
color: var(--heo-secondtext);
|
||||
margin-top: 0.5rem;
|
||||
margin-top: 0.4rem;
|
||||
}
|
||||
|
||||
@media screen and (max-width: 1300px) {
|
||||
|
@ -12423,12 +12431,52 @@ a.reward-main-btn:hover {
|
|||
}
|
||||
|
||||
|
||||
/* 接下来下一篇 */
|
||||
/* 接下来下一篇 */
|
||||
.next-post.pull-right,
|
||||
.prev-post.pull-left,
|
||||
#pagination .prev-post,
|
||||
#pagination .next-post {
|
||||
background: var(--heo-secondbg);
|
||||
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);
|
||||
}
|
||||
|
||||
@media screen and (min-width: 768px) {
|
||||
|
@ -12505,12 +12553,17 @@ a.reward-main-btn:hover {
|
|||
|
||||
#post #pagination .prev-post .label,
|
||||
#pagination .next-post .label {
|
||||
color: var(--heo-fontcolor);
|
||||
color: white;
|
||||
}
|
||||
|
||||
#post #pagination .prev-post2 .label,
|
||||
#pagination .next-post2 .label {
|
||||
color: white;
|
||||
}
|
||||
|
||||
#post #pagination .prev_info,
|
||||
#pagination .next_info {
|
||||
color: var(--heo-fontcolor);
|
||||
color: white;
|
||||
font-weight: bold;
|
||||
-webkit-line-clamp: 2;
|
||||
white-space: normal;
|
||||
|
@ -12818,14 +12871,15 @@ a.reward-main-btn:hover {
|
|||
}
|
||||
|
||||
.relatedPosts > .relatedPosts-list > div {
|
||||
background: var(--heo-background);
|
||||
background: #363636;
|
||||
transition: 0.3s;
|
||||
cursor: pointer;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
.relatedPosts > .relatedPosts-list > div:hover {
|
||||
background: var(--heo-main);
|
||||
.relatedPosts > .relatedPosts-list > div:hover #preimg{
|
||||
opacity: 1;
|
||||
transform: scale(1.1);
|
||||
}
|
||||
|
||||
@media screen and (max-width: 768px) {
|
||||
|
@ -12854,12 +12908,11 @@ a.reward-main-btn:hover {
|
|||
line-height: 1.5;
|
||||
-webkit-line-clamp: 4;
|
||||
font-size: 0.9rem;
|
||||
text-align: left;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.relatedPosts > .relatedPosts-list .content .date {
|
||||
color: var(--heo-fontcolor);
|
||||
display: none;
|
||||
}
|
||||
|
||||
/* 分割线 */
|
||||
|
@ -17676,3 +17729,6 @@ a.toc-link {
|
|||
#nav .menus_items .menus_item .menus_item_child li a:hover {
|
||||
padding: 0.2rem 0.5rem;
|
||||
}
|
||||
.postcarnepre{
|
||||
width: 100%;
|
||||
}
|
||||
|
|
|
@ -39,7 +39,7 @@
|
|||
th:href="@{${post.status.permalink}}"
|
||||
th:text="${post.spec.title}">
|
||||
</a>
|
||||
<!-- <div class="content" th:text="${post.status.excerpt}"></div> -->
|
||||
<div class="content" th:if="${theme.config.post.summarize}" th:text="${post.status.excerpt}"></div>
|
||||
</div>
|
||||
|
||||
|
||||
|
|
|
@ -3,23 +3,39 @@
|
|||
<!-- 归档 -->
|
||||
<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">
|
||||
<div class="aside-list" id="newcomm">
|
||||
|
||||
<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">
|
||||
</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}">
|
||||
</a>
|
||||
<div class="content">
|
||||
<a class="comment" href="/messageboard/#635ba6370ccf12000f30a175" title="test">
|
||||
评论模块未完成
|
||||
<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>
|
||||
<div class="name">
|
||||
<span>liuzhihang / </span>
|
||||
<time datetime="2022-10-28T09:51:51.581Z">20 小時前</time>
|
||||
<span>${items.nick} / </span>
|
||||
<time datetime="${items.created}">${items.relativeTime}</time>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>`
|
||||
});
|
||||
document.querySelector('#newcomm').innerHTML = commenthtml;
|
||||
}).catch(function (err) {
|
||||
// 发生错误
|
||||
console.error(err);
|
||||
});
|
||||
</script>
|
||||
</html>
|
|
@ -226,16 +226,20 @@
|
|||
</div>
|
||||
<nav class="pagination-post" id="pagination"
|
||||
th:with="postCursor = ${postFinder.cursor(post.metadata.name)}">
|
||||
<div class="prev-post pull-left">
|
||||
<div th:class="${postCursor.hasPrevious()==true && postCursor.hasNext()==false} ? 'prev-post2 pull-left postcarnepre' : '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 class="next-post pull-right">
|
||||
<div th:class="${postCursor.hasPrevious()==false && postCursor.hasNext()==true} ? 'next-post2 pull-right postcarnepre':'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>
|
||||
|
@ -254,13 +258,13 @@
|
|||
<!-- 建议阅读,这里可以自定义文章数量,然后遍历展示 -->
|
||||
<div th:each="recommandPost :${recommandPosts}">
|
||||
<a th:href="@{${recommandPost.status.permalink}}" th:title="${recommandPost.spec.title}">
|
||||
<img alt="cover" class="cover" loading="lazy"
|
||||
<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"><i class="far fa-calendar-alt fa-fw"></i>
|
||||
<div class="date" style="color: white"><i class="far fa-calendar-alt fa-fw"></i>
|
||||
[[${#dates.format(recommandPost.spec.publishTime,'yyyy-MM-dd HH:mm:ss')}]]
|
||||
</div>
|
||||
<div class="title" th:text="${recommandPost.spec.title}"></div>
|
||||
<div class="title" style="color: white" th:text="${recommandPost.spec.title}"></div>
|
||||
</div>
|
||||
</a>
|
||||
</div>
|
||||
|
|
Loading…
Reference in New Issue