Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 10 additions & 5 deletions _includes/views/pagination.html
Original file line number Diff line number Diff line change
@@ -1,14 +1,19 @@
{%- if page.paginator -%}
{%- assign params = include -%}
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @cengique, I can not understand why you assign this params variable but never use it.

{%- if include.paginator -%}
{%- assign paginator = include.paginator -%}
{%- elsif layout.paginator -%}
{%- assign paginator = layout.paginator -%}
{%- elsif page.paginator -%}
{%- assign paginator = page.paginator -%}
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

when we are using the page.paginator, it is from jekyll-paginate, the paginator has no the size attribute, it will cause the corruption.

{%- elsif paginator == nil -%}
{%- assign paginator = site -%}
{%- assign paginator = site.posts -%}
{%- endif -%}

{%- if paginator.posts.size > 0 -%}
{%- if paginator.size > 0 -%}
<div class="pagination">
<!-- Post list links -->
<ul class="post-list">
{%- for post in paginator.posts -%}
{%- for post in paginator -%}
<li>
{%- assign date_format = site.yat.date_format | default: "%b %-d, %Y" -%}

Expand Down Expand Up @@ -42,7 +47,7 @@ <h2 class="post-title">
</ul>

<!-- Pagination links -->
{%- if paginator.posts.size < site.posts.size -%}
{%- if paginator.size < site.posts.size -%}
{%- include views/paginator.html -%}
{%- endif -%}
</div>
Expand Down