自定义的文章右上角的推荐文章修改成可选择文章

This commit is contained in:
1152958806@qq.com 2023-08-11 23:02:44 +08:00
parent bd398066b2
commit 6957def8c6
3 changed files with 27 additions and 33 deletions

View File

@ -373,17 +373,13 @@ spec:
name: recommendPostCustom name: recommendPostCustom
label: 自定义文章 label: 自定义文章
help: 建议设置六篇文章 help: 建议设置六篇文章
value: [ ] max: 6
children: children:
- $formkit: url - $formkit: postSelect
name: url name: post
label: 链接 label: 文章
- $formkit: text value: ""
name: title validation: required
label: 标题
- $formkit: attachment
name: cover
label: 封面地址
- group: layout - group: layout
label: 布局 label: 布局
@ -1540,9 +1536,6 @@ spec:
label: 描述 label: 描述
value: 每一张照片都是一次美好的记忆。 value: 每一张照片都是一次美好的记忆。
- group: todo - group: todo
label: 待办清单 label: 待办清单
formSchema: formSchema:
@ -1961,7 +1954,6 @@ spec:
value: <div class="author-content-item-tips">心路历程</div> <span class="author-content-item-title">为什么建站?</span> <br>创建这个站的时候,想要就是能够有一个自己能够<b>积累知识、积累兴趣</b>的地方。和他人分享,会让这些成为积累和沉淀。如果能够帮助到更多的人,帮助更多人解决问题,那一定是非常棒的事情。<br> 分享这件事我从很早就开始了,起初做的微信公众号,现在做的网站。因为我比较喜欢研究数码和软件,想要探究在互联网上的事物是如何被创造和发展。网络给我带来了非常多的知识和眼界,我也想力所能及的分享一些我生活的琐碎知识。<br>与大多数垂直类的技术博客不同,这里的种类会非常的繁杂,有<b>技能的教程干货</b>、有<b>生活上的吐槽和妙招</b>、有<b>话题上的思考和想法</b>。一般我研究什么、发现了什么都会分享在这里。<br> 这些就是创造这个小站的本意,<b>也是我分享生活的方式</b>。有幸能和你相遇在这里,相信我们能共同留下一段美好记忆。</p> value: <div class="author-content-item-tips">心路历程</div> <span class="author-content-item-title">为什么建站?</span> <br>创建这个站的时候,想要就是能够有一个自己能够<b>积累知识、积累兴趣</b>的地方。和他人分享,会让这些成为积累和沉淀。如果能够帮助到更多的人,帮助更多人解决问题,那一定是非常棒的事情。<br> 分享这件事我从很早就开始了,起初做的微信公众号,现在做的网站。因为我比较喜欢研究数码和软件,想要探究在互联网上的事物是如何被创造和发展。网络给我带来了非常多的知识和眼界,我也想力所能及的分享一些我生活的琐碎知识。<br>与大多数垂直类的技术博客不同,这里的种类会非常的繁杂,有<b>技能的教程干货</b>、有<b>生活上的吐槽和妙招</b>、有<b>话题上的思考和想法</b>。一般我研究什么、发现了什么都会分享在这里。<br> 这些就是创造这个小站的本意,<b>也是我分享生活的方式</b>。有幸能和你相遇在这里,相信我们能共同留下一段美好记忆。</p>
help: 支持 HTML 语法 help: 支持 HTML 语法
- group: aboutReward - group: aboutReward
label: 关于(打赏) label: 关于(打赏)
formSchema: formSchema:

View File

@ -1,6 +1,6 @@
<!DOCTYPE html> <!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org"> <html lang="en" xmlns:th="http://www.thymeleaf.org">
<th:div th:fragment="author-content(background, smallTitle, bigTitle, detail,buttonUrl,buttonTitle)" <div th:fragment="author-content(background, smallTitle, bigTitle, detail,buttonUrl,buttonTitle)"
class="author-content author-content-item essayPage single" class="author-content author-content-item essayPage single"
th:style="'background:url('+${background}+') left 28% / cover no-repeat !important;'"> th:style="'background:url('+${background}+') left 28% / cover no-repeat !important;'">
<div class="card-content"> <div class="card-content">
@ -16,6 +16,6 @@
</a> </a>
</div> </div>
</div> </div>
</th:div> </div>
</html> </html>

View File

@ -31,23 +31,25 @@
<div class="recent-post-item" <div class="recent-post-item"
th:each="cuscomPost : ${theme.config.top.BannerRight.recommendPostCustom}" th:each="cuscomPost : ${theme.config.top.BannerRight.recommendPostCustom}"
th:if="${#strings.equals(theme.config.top.BannerRight.recommendPost, 'custom')}"> th:if="${#strings.equals(theme.config.top.BannerRight.recommendPost, 'custom')}">
<th:block th:with="post = ${postFinder.getByName(cuscomPost.post)}">
<div class="post_cover"> <div class="post_cover">
<a th:href="@{${cuscomPost.url}}" th:title="${cuscomPost.title}"> <a th:href="@{${post.status.permalink}}" th:title="${post.spec.title}">
<span class="recent-post-top-text" <span class="recent-post-top-text"
th:attr="onclick='pjax.loadUrl(\''+ @{${cuscomPost.url}} +'\')'">荐</span> th:attr="onclick='pjax.loadUrl(\''+ @{${post.status.permalink}} +'\')'">荐</span>
<img class="post_bg" loading="lazy" <img class="post_bg" loading="lazy"
th:alt="${cuscomPost.title}" th:alt="${post.spec.title}"
th:src='${#strings.isEmpty(cuscomPost.cover) ? postRandomImg+","+cuscomPost.title : cuscomPost.cover}' th:src='${#strings.isEmpty(post.spec.cover) ? postRandomImg+","+post.spec.title : post.spec.cover}'
/> />
</a> </a>
</div> </div>
<div class="recent-post-info"> <div class="recent-post-info">
<a class="article-title" <a class="article-title"
th:href="@{${cuscomPost.url}}" th:href="@{${post.status.permalink}}"
th:text="${cuscomPost.title}" th:text="${post.spec.title}"
th:title="${cuscomPost.title}"> th:title="${post.spec.title}">
</a> </a>
</div> </div>
</th:block>
</div> </div>
<!-- 今日推荐 --> <!-- 今日推荐 -->