-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathcategory.html
30 lines (25 loc) · 1.01 KB
/
category.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
<section id="posts" class="posts-collapse" hidden>
<div class="collection-title">
<{% if site.seo %}h2{% else %}h1{% endif %}>
{{ page.title }}
<small>{{ __.title.category }}</small>
</{% if site.seo %}h2{% else %}h1{% endif %}>
</div>
{% assign paginate = site.category.paginate | default: site.paginate %}
{% assign paginate_path = site.category.paginate_path | default: site.paginate_path %}
{% for cat_posts in site.categories %}
{% assign cat = cat_posts[0] | url_encode | replace: '+', '%20' %}
{% assign posts = cat_posts[1] %}
{% for post in posts %}
{% if paginate > 0 %}
{% assign page_num = forloop.index0 | divided_by: paginate | plus: 1 %}
{% assign route = '/' | append: cat %}
{% if page_num != 1 %}
{% assign route = route | append: paginate_path | replace: ':num', page_num %}
{% endif %}
{% endif %}
{% include _macro/post-collapse.html %}
{% endfor %}
{% endfor %}
</section>
<nav class="pagination"></nav>