Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 6119d06

Browse files
authored
added ability to switch off pagination on the blog page (alshedivat#1909)
1 parent a1a9250 commit 6119d06

File tree

1 file changed

+11
-2
lines changed

1 file changed

+11
-2
lines changed

blog/index.html

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,14 @@ <h3 class="card-title text-lowercase">{{ post.title }}</h3>
9595
{% endif %}
9696

9797
<ul class="post-list">
98-
{% for post in paginator.posts %}
98+
99+
{%- if page.pagination.enabled -%}
100+
{%- assign postlist = paginator.posts -%}
101+
{%- else -%}
102+
{%- assign postlist = site.posts -%}
103+
{%- endif -%}
104+
105+
{% for post in postlist %}
99106

100107
{% if post.external_source == blank %}
101108
{% assign read_time = post.content | number_of_words | divided_by: 180 | plus: 1 %}
@@ -163,6 +170,8 @@ <h3>
163170
{% endfor %}
164171
</ul>
165172

166-
{% include pagination.html %}
173+
{%- if page.pagination.enabled -%}
174+
{%- include pagination.html -%}
175+
{%- endif -%}
167176

168177
</div>

0 commit comments

Comments
 (0)