-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpaginate.html
42 lines (40 loc) · 1.68 KB
/
paginate.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
---
layout: page
---
{{ content }}
<div class="d-flex flex-wrap gutter-spacious">
<!-- This loops through the paginated posts -->
{%- for post in paginator.posts %}
{%- if post.feature or post == site.posts[0] %}
{%- include post-feature-card.html %}
{%- else %}
{%- include post-card.html border="border-top" %}
{%- endif %}
{% endfor %}
</div>
<!-- Pagination links -->
<div class="paginate-container">
<div role="navigation" aria-label="Pagination" class="d-flex d-md-inline-block pagination">
{%- if paginator.previous_page %}
<a class="previous_page" rel="prev" href="{{ paginator.previous_page_path | relative_url }}"
aria-disabled="false">Previous</a>
{% else %}
<span class="previous_page disabled" aria-disabled="true">Previous</span>
{% endif %}
{%- for blog_page in (1..paginator.total_pages) %}
{%- if blog_page == paginator.page %}
<a href="{{ page.url | relative_url }}" aria-label="{{ blog_page }}" aria-current="page">{{ blog_page }}</a>
{% elsif blog_page == 1 %}
<a href="{{ site.paginate_path | relative_url | replace: 'page:num', '' }}" aria-label="{{ blog_page }}">{{ blog_page }}</a>
{% else %}
<a href="{{ site.paginate_path | relative_url | replace: ':num', blog_page }}" aria-label="{{ blog_page }}">{{ blog_page }}</a>
{%- endif %}
{%- endfor %}
{%- if paginator.next_page %}
<a class="next_page" rel="next" href="{{ paginator.next_page_path | relative_url }}"
aria-disabled="false">Next</a>
{% else %}
<span class="next_page disabled" aria-disabled="true">Next</span>
{% endif %}
</div>
</div>