Skip to content

Commit 5a3a65b

Browse files
authored
Merge pull request #23 from ruibaby/require-1.3.0
require 1.3.0
2 parents 863ad31 + 57db4cc commit 5a3a65b

38 files changed

+333
-346
lines changed

archives.ftl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<#--归档界面ok-->
22
<#--界面,间距,颜色,功能,逻辑-->
33
<#include "module/layout.ftl">
4-
<@layout title="归档 | ${options.blog_title!}" keywords="${options.seo_keywords!}" description="${options.seo_description!}">
4+
<@layout title="归档 | ${blog_title!}">
55
<section id="archives" class="container px-lg-2 pt-3 pb-5 bg-white">
66
<div class="row">
77
<div id="left" class="col-lg-8 pr-lg-5 pl-lg-4 mt-lg-4">

categories.ftl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<#--分类列表界面OK-->
22
<#include "module/layout.ftl">
3-
<@layout title="分类列表 | ${options.blog_title!}" keywords="${options.seo_keywords!}" description="${options.seo_description!}">
3+
<@layout title="分类列表 | ${blog_title!}">
44
<section id="archives" class="container px-lg-2 pt-3 pb-5 bg-white">
55
<div class="row">
66
<div id="left" class="col-lg-8 pr-lg-5 pl-lg-4 mt-lg-4">

category.ftl

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,7 @@
11
<#--分类界面ok-->
22
<#--界面,间距,颜色,功能,逻辑-->
33
<#include "module/layout.ftl">
4-
<@layout title="${category.name!} | ${options.blog_title!}"
5-
keywords="${options.seo_keywords!}"
6-
description="${options.seo_description!}">
4+
<@layout title="${category.name!} | ${blog_title!}">
75
<div class="container px-lg-2 pb-3 bg-white">
86
<#--左右两列盒子-->
97
<div class="row mb-3">

index.ftl

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,7 @@
11
<#-- 首页界面ok -->
22
<#--界面,间距,颜色,功能,逻辑-->
33
<#include "module/layout.ftl">
4-
<@layout title="首页 | ${options.blog_title!}"
5-
keywords="${options.seo_keywords!}"
6-
description="${options.seo_description!}">
4+
<@layout title="首页 | ${blog_title!}">
75
<div class="container px-lg-2 pb-3 bg-white">
86
<#--左右两列盒子-->
97
<div class="row mb-3">

journals.ftl

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,7 @@
11
<#--日志界面OK-->
22
<#include "module/layout.ftl">
33
<@layout
4-
title="${user.nickname!}的日志 | ${options.blog_title!}"
5-
keywords="${options.seo_keywords!}"
6-
description="${options.seo_description!}">
4+
title="${user.nickname!}的日志 | ${blog_title!}">
75

86
<#--下方正文部分-->
97
<div class="container-fluid" style="background: #f8fafc;">

links.ftl

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,17 @@
11
<#--链接页面OK-->
22
<#include "module/layout.ftl">
3-
<@layout title="链接 | ${options.blog_title!}" keywords="${options.seo_keywords!}" description="${options.seo_description!}">
3+
<@layout title="链接 | ${blog_title!}">
44

5-
<link rel="stylesheet" href="${static!}/source/css/links.css">
5+
<link rel="stylesheet" href="${theme_base!}/source/css/links.css">
66
<style>
77
/* 链接分类、链接鼠标划过字体颜色 */
88
#linkCategory .category-button:hover, .link-grid .link:hover {
9-
color: ${settings.hover_color?default('#dc3545')} !important;
9+
color: ${settings.hover_color!'#dc3545'} !important;
1010
}
1111
1212
/* 链接分类被激活的时候 */
1313
.category-active {
14-
color: ${settings.hover_color?default('#dc3545')} !important;
14+
color: ${settings.hover_color!'#dc3545'} !important;
1515
}
1616
</style>
1717
@@ -34,11 +34,11 @@
3434
<div class="d-flex flex-column align-items-center mt-2 pt-5">
3535
<span class="text-muted"><i class="fas fa-inbox fa-7x"></i></span>
3636
<span class="text-muted mt-4 mb-5">
37-
还没有链接,回<a class="font-weight-bold" href="${context!}">主页</a>看看吧
37+
还没有链接,回<a class="font-weight-bold" href="${blog_url!}">主页</a>看看吧
3838
</span>
3939
</div>
4040
</div>
4141
</div>
4242
</div>
4343
</@layout>
44-
<script src="${static!}/source/js/links.js"></script>
44+
<script src="${theme_base!}/source/js/links.js"></script>

module/archives/archive_item.ftl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
<ul class="title-list">
1919
<#list archive.posts?sort_by("createTime")?reverse as post>
2020
<li class="d-flex flex-sm-row flex-column justify-content-between pr-3">
21-
<a href="${context!}/archives/${post.url!}">${post.title!}</a>
21+
<a href="${post.fullPath!}">${post.title!}</a>
2222
<small class="text-muted">${post.createTime?string["yyyy年MM月dd日"]!}</small>
2323
</li>
2424
</#list>

module/category/left.ftl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
<div class="d-flex flex-column align-items-center mt-5 pt-5">
1616
<span class="text-muted"><i class="fas fa-inbox fa-7x"></i></span>
1717
<span class="text-muted mt-4 mb-5">
18-
"${category.name!}"分类下啥都没有,回<a class="font-weight-bold" href="${context!}">主页</a>看看吧
18+
"${category.name!}"分类下啥都没有,回<a class="font-weight-bold" href="${blog_url!}">主页</a>看看吧
1919
</span>
2020
</div>
2121
<#else>
@@ -38,7 +38,7 @@
3838
</#list>
3939
<#--分页-->
4040
<#include "pagination.ftl">
41-
<@pagination posts=posts rainbow=rainbow slugName=category.slugName/>
41+
<@pagination posts=posts slug=category.slug/>
4242
</#if>
4343

4444

module/category/pagination.ftl

Lines changed: 48 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -1,52 +1,53 @@
11
<#--分类界面的分页ok-->
2-
<#macro pagination posts rainbow slugName>
2+
<#macro pagination posts slug>
33
<#if posts.getTotalPages() gt 0>
4-
<section id="pagination" class="mt-5 mb-lg-3 d-flex justify-content-center">
5-
<nav aria-label="切换上下页">
6-
<ul class="pagination">
7-
<#--上一页部分-->
8-
<li class="page-item <#if posts.number lte 0>disabled</#if>">
9-
<#if posts.number lte 0>
10-
<a class="page-link" href="${context!}/categories/${slugName}/page/1" tabindex="-1"
11-
aria-disabled="true">&laquo;</a>
12-
<#else>
13-
<a class="page-link"
14-
href="${context!}/categories/${slugName}/page/${posts.number}"
15-
aria-label="上一页">
16-
<span aria-hidden="true">&laquo;</span>
17-
</a>
18-
</#if>
19-
</li>
20-
<#--页码部分-->
21-
<#list rainbow as r>
22-
<#if r == posts.number + 1>
23-
<li class="page-item active" aria-current="page">
24-
<a class="page-link" href="javascript:void(0)">${posts.number + 1} <span
25-
class="sr-only">(current)</span></a>
26-
</li>
27-
<#else>
28-
<li class="page-item">
29-
<a href="${context!}/categories/${slugName}/page/${r}"
30-
class="page-link">${r}
4+
<@paginationTag method="categoryPosts" page="${posts.number}" total="${posts.totalPages}" display="3" slug="${slug!}">
5+
<section id="pagination" class="mt-5 mb-lg-3 d-flex justify-content-center">
6+
<nav aria-label="切换上下页">
7+
<ul class="pagination">
8+
<#--上一页部分-->
9+
<li class="page-item <#if !pagination.hasPrev>disabled</#if>">
10+
<#if !pagination.hasPrev>
11+
<a class="page-link" tabindex="-1"
12+
aria-disabled="true">&laquo;</a>
13+
<#else>
14+
<a class="page-link"
15+
href="${pagination.prevPageFullPath!}"
16+
aria-label="上一页">
17+
<span aria-hidden="true">&laquo;</span>
3118
</a>
32-
</li>
33-
</#if>
34-
</#list>
35-
<#--下一页部分-->
36-
<li class="page-item <#if posts.getTotalPages() lte posts.number + 1>disabled</#if>">
37-
<#if posts.getTotalPages() lte posts.number + 1>
38-
<a class="page-link" href="javascript:void(0)" tabindex="-1"
39-
aria-disabled="true">&raquo;</a>
40-
<#else>
41-
<a class="page-link"
42-
href="${context!}/categories/${slugName}/page/${posts.number + 2}"
43-
aria-label="下一页">
44-
<span aria-hidden="true">&raquo;</span>
45-
</a>
46-
</#if>
47-
</li>
48-
</ul>
49-
</nav>
50-
</section>
19+
</#if>
20+
</li>
21+
<#--页码部分-->
22+
<#list pagination.rainbowPages as number>
23+
<#if number.isCurrent>
24+
<li class="page-item active" aria-current="page">
25+
<a class="page-link" href="javascript:void(0)">
26+
${number.page!}
27+
<span class="sr-only">(current)</span>
28+
</a>
29+
</li>
30+
<#else>
31+
<li class="page-item">
32+
<a class="page-link" href="${number.fullPath!}">${number.page!}</a>
33+
</li>
34+
</#if>
35+
</#list>
36+
<#--下一页部分-->
37+
<li class="page-item <#if !pagination.hasNext>disabled</#if>">
38+
<#if !pagination.hasNext>
39+
<a class="page-link" href="javascript:void(0)" tabindex="-1"
40+
aria-disabled="true">&raquo;</a>
41+
<#else>
42+
<a class="page-link" href="${pagination.nextPageFullPath!}"
43+
aria-label="下一页">
44+
<span aria-hidden="true">&raquo;</span>
45+
</a>
46+
</#if>
47+
</li>
48+
</ul>
49+
</nav>
50+
</section>
51+
</@paginationTag>
5152
</#if>
5253
</#macro>

module/categrories/category_item.ftl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
<@postTag method="listByCategoryId" categoryId="${category.id}">
2020
<#list posts?sort_by("createTime") as post>
2121
<li class="d-flex flex-sm-row flex-column justify-content-between pr-3">
22-
<a href="${context!}/archives/${post.url!}">${post.title!}</a>
22+
<a href="${post.fullPath!}">${post.title!}</a>
2323
<small class="text-muted">${post.createTime?string["yyyy年MM月dd日"]!}</small>
2424
</li>
2525
</#list>

0 commit comments

Comments
 (0)