Skip to content

Commit

Permalink
Merge pull request #13 from liuzhihang/dev
Browse files Browse the repository at this point in the history
Dev
  • Loading branch information
liuzhihang authored Nov 21, 2022
2 parents 118c8ce + 6157595 commit 374f248
Show file tree
Hide file tree
Showing 5 changed files with 88 additions and 36 deletions.
21 changes: 4 additions & 17 deletions settings.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -75,9 +75,7 @@ spec:
name: bannersIconPair
label: Banner 滚动图标
help: 为空时会使用系统内置图标
value:
- top:
bottom:
value: []
children:
- $formkit: group
name: top
Expand Down Expand Up @@ -190,10 +188,7 @@ spec:
name: recommendPostCustom
label: 自定义文章
help: "建议设置六篇文章"
value:
- url:
title:
cover:
value: []
children:
- $formkit: url
name: url
Expand Down Expand Up @@ -301,11 +296,7 @@ spec:
name: socialMedia
label: 社交媒体
help: 侧栏社交媒体建议只设置两个
value:
- icon:
name:
url:
urlType: normal
value: []
children:
- $formkit: select
name: icon
Expand Down Expand Up @@ -407,11 +398,7 @@ spec:
- $formkit: repeater
name: socialMedia
label: 社交媒体
value:
- icon:
name:
url:
urlType: normal
value: []
children:
- $formkit: select
name: icon
Expand Down
35 changes: 35 additions & 0 deletions templates/categories.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
<!DOCTYPE html>
<html lang="en" th:replace="modules/layouts/layout :: layout(content = ~{::content}, htmlType = 'category')"
xmlns:th="http://www.thymeleaf.org">

<th:block th:fragment="content">

<div class="page" id="body-wrap">
<header class="not-top-img" id="page-header">
<nav th:replace="modules/nav :: nav"></nav>
</header>
<main class="layout hide-aside" id="content-inner">

<div id="page">
<h1 class="page-title" style="display: inline;">分类</h1>
<div class="category-lists">
<div class="category-title is-center">分类 - <span class="category-amount">11</span></div>
<div class="tag-cloud-list is-center">
<a style="font-size: 1em;"
th:each="categoryItem : ${categoryFinder.listAll()}"
th:href="@{${categoryItem.status.permalink}}"
th:id="${categoryItem.spec.displayName}">
<span class="tags-punctuation">#</span>
[[${categoryItem.spec.displayName}]]
<span class="tagsPageCount">[[${categoryItem.postCount}]]</span></a>
</div>
</div>
</div>
</main>
<!-- 底部 -->
<footer th:replace="modules/footer :: footer"></footer>
</div>

</th:block>

</html>
24 changes: 11 additions & 13 deletions templates/modules/post-list.html
Original file line number Diff line number Diff line change
Expand Up @@ -70,10 +70,9 @@
</div>


<nav id="pagination" th:if="${posts.hasPrevious() || posts.hasNext()}">

<nav id="pagination" th:if="${posts.hasPrevious() || posts.hasNext()}" th:with="totalPages = ${posts.totalPages}, pageIndex = ${posts.page}">
<!-- 页面小于 7 -->
<div class="pagination" th:if="${(posts.totalPages le 7) && (posts.totalPages gt 0)}">
<div class="pagination" th:if="${(totalPages le 7) && (totalPages gt 0)}">

<!-- 上一页 -->
<a class="extend prev" rel="prev" th:href="@{${posts.prevUrl}}" th:if="${posts.hasPrevious()}">
Expand All @@ -84,7 +83,7 @@
<!-- th:href="${PostFinder.list(index, posts.size)}" -->
<a class="page-number"
th:classappend="${index eq pageIndex} ? 'current'"
th:each="index : ${#numbers.sequence(1, posts.totalPages)}"
th:each="index : ${#numbers.sequence(1, totalPages)}"
th:text="${index}">
</a>

Expand All @@ -99,7 +98,7 @@

<!-- 页面大于 7 -->
<!-- https://blog.csdn.net/lizc_lizc/article/details/80215147 -->
<div class="pagination" th:if="${posts.totalPages gt 7}">
<div class="pagination" th:if="${totalPages gt 7}">

<!-- 上一页 -->
<a class="extend prev" rel="prev" th:href="@{${posts.prevUrl}}" th:if="${posts.hasPrevious()}">
Expand All @@ -125,41 +124,40 @@

<!-- 最后一页与当前页面之差小于等于3 -->
<!-- 需要添加 th:href 跳转地址 -->
<a class="page-number" th:if="${posts.totalPages - pageIndex le 3}">...</a>
<a class="page-number" th:if="${totalPages - pageIndex le 3}">...</a>
<!-- 需要添加 th:href 跳转地址 -->
<a class="page-number"
th:classappend="${index eq pageIndex} ? 'current'"
th:each="index : ${#numbers.sequence(posts.totalPages - 4, posts.totalPages - 1)}"
th:if="${posts.totalPages - pageIndex le 3}"
th:each="index : ${#numbers.sequence(totalPages - 4, totalPages - 1)}"
th:if="${totalPages - pageIndex le 3}"
th:text="${index}">
</a>


<!-- 最后一页与当前页面之差大于3 且当前页面大于4 -->
<!-- 需要添加 th:href 跳转地址 -->
<a class="page-number" th:if="${(pageIndex gt 4) && (posts.totalPages - pageIndex gt 3)}">...</a>
<a class="page-number" th:if="${(pageIndex gt 4) && (totalPages - pageIndex gt 3)}">...</a>
<!-- 需要添加 th:href 跳转地址 -->
<a class="page-number"
th:each="index : ${#numbers.sequence(pageIndex - 1,pageIndex + 1)}"
th:if="${(pageIndex gt 4) && (posts.totalPages - pageIndex gt 3)}"
th:if="${(pageIndex gt 4) && (totalPages - pageIndex gt 3)}"
th:text="${index}">
</a>
<!-- 需要添加 th:href 跳转地址 -->
<a class="page-number" th:if="${(pageIndex gt 4) && (posts.totalPages - pageIndex gt 3)}">...</a>
<a class="page-number" th:if="${(pageIndex gt 4) && (totalPages - pageIndex gt 3)}">...</a>

<!-- 尾页 -->
<!-- 需要添加 th:href 跳转地址 -->
<a class="page-number"
th:classappend="${index eq pageIndex} ? 'current'"
th:text="${posts.totalPages}">
th:text="${totalPages}">
</a>

<!-- 下一页 -->
<a class="extend next" rel="next" th:href="@{${posts.nextUrl}}" th:if="${posts.hasNext()}">
<div class="pagination_tips_next">下页</div>
<i class="iconfont icon-chevron-right"></i>
</a>

</div>

</nav>
Expand Down
12 changes: 6 additions & 6 deletions templates/modules/widgets/top-group.html
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">

<!-- 可以是最近六篇文章,也可以是自定义的文章 -->
<div class="topGroup" th:fragment="top-group">
<!-- 可以是最近六篇文章 -->
<div class="topGroup" th:fragment="top-group" th:with="topGroupPosts = ${postFinder.list(1,6)}">
<div class="recent-post-item"
th:each="post : ${posts}"
th:if="${#strings.equals(theme.config.top.recommendPost, 'latest')}"
th:with="posts = ${postFinder.list(1,6)}">
th:each="post : ${topGroupPosts}"
th:if="${#strings.equals(theme.config.top.recommendPost, 'latest')}">

<div class="post_cover">
<a th:href="@{${post.status.permalink}}" th:title="${post.spec.title}">
<span class="recent-post-top-text"></span>
Expand All @@ -23,7 +23,7 @@
</a>
</div>
</div>

<!-- 自定义的文章右上角的推荐文章 -->
<div class="recent-post-item"
th:each="cuscomPost : ${theme.config.top.recommendPostCustom}"
th:if="${#strings.equals(theme.config.top.recommendPost, 'custom')}">
Expand Down
32 changes: 32 additions & 0 deletions templates/tags.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
<!DOCTYPE html>
<html lang="en" th:replace="modules/layouts/layout :: layout(content = ~{::content}, htmlType = 'tag')"
xmlns:th="http://www.thymeleaf.org">

<th:block th:fragment="content">

<div class="page" id="body-wrap">
<header class="not-top-img" id="page-header">
<nav th:replace="modules/nav :: nav"></nav>
</header>
<main class="layout hide-aside" id="content-inner">
<div id="page"><h1 class="page-title" style="display: inline;">标签</h1>
<div class="tag-cloud-title is-center">标签 - <span class="tag-cloud-amount">0</span></div>
<div class="tag-cloud-list is-center">
<a th:each="tagItem : ${tagFinder.listAll()}"
th:href="@{${tagItem.status.permalink}}"
th:id="${tagItem.spec.displayName}" th:style="'font-size: 1em; color:' + ${tagItem.spec.color} ">
<span class="tags-punctuation">#</span>
[[${tagItem.spec.displayName}]]
<span class="tagsPageCount">[[${tagItem.postCount}]]</span>
</a>

</div>
</div>
</main>
<!-- 底部 -->
<footer th:replace="modules/footer :: footer"></footer>
</div>

</th:block>

</html>

0 comments on commit 374f248

Please sign in to comment.