Skip to content

Commit

Permalink
Merge pull request #146 from Strangeen/bugfix
Browse files Browse the repository at this point in the history
bugfix
  • Loading branch information
cofess authored Jan 3, 2022
2 parents 3e47b56 + e1ab9d1 commit 348dab7
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 5 deletions.
2 changes: 2 additions & 0 deletions _config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,8 @@ pagination:
alwayShow: true
next:
alwayShow: true
midSize: 2 # 当前页码左右到省略号显示的页码数,默认2,表现为 1 ... 4 5 6 7 8 ... 10
showContent: true # 页面文章小于2篇时显示文章内容

# Sidebar
sidebar: right
Expand Down
2 changes: 1 addition & 1 deletion layout/_partial/archive-list.ejs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<% if (page.posts.length < 2){ %>
<% if (theme.pagination.showContent && page.posts.length < 2){ %>
<% page.posts.each(function(post){ %>
<%- partial('article', {post: post, index: true}) %>
<% }) %>
Expand Down
5 changes: 3 additions & 2 deletions layout/_partial/pagination.ejs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@
<% } %>
<%- paginator({
prev_text: '<i class="icon icon-angle-left"></i> ' + __('pagination.prev'),
next_text: __('pagination.next') + ' <i class="icon icon-angle-right"></i>'
next_text: __('pagination.next') + ' <i class="icon icon-angle-right"></i>',
escape: false, mid_size: theme.pagination.midSize ? theme.pagination.midSize : 2
}) %>
<% if (!page.next && theme.pagination.next.alwayShow) { %>
<a class="next disabled" href="javascript:;"><%= __('pagination.next') %> <i class="icon icon-angle-right"></i></a>
Expand Down Expand Up @@ -52,7 +53,7 @@
</li>
<% } %>
</ul>
<div class="total-article bar-right"><%= _p('pagination.pageof', page.current, page.total) %></div>
<div class="total-article bar-right"><%= _p('pagination.pageof', page.current, page.total) %></div>
</div>
</nav>
<% } %>
Expand Down
2 changes: 1 addition & 1 deletion layout/archive.ejs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
<article class="content article article-archives article-type-list" itemscope="">
<header class="article-header">
<h1 itemprop="title"><% if (title){ %><%= title %><% } %></h1>
<p class="text-muted"><%= _p('total.article', page.posts.length) %></p>
<p class="text-muted"><%= _p('total.article', site.posts.length) %></p>
</header>
<div class="article-body">
<%- partial('_partial/archive', {pagination: config.archive, index: true}) %>
Expand Down
2 changes: 1 addition & 1 deletion source/css/style.css
Original file line number Diff line number Diff line change
Expand Up @@ -5865,7 +5865,7 @@ body.no-sidebar .sidebar {
.main .pager > a,
.main .pager > .page-number {
line-height: 32px;
float: left;
/* float: left; */
}

.main .pager a {
Expand Down

0 comments on commit 348dab7

Please sign in to comment.