-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy patharchive.html
55 lines (47 loc) · 1.98 KB
/
archive.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
43
44
45
46
47
48
49
50
51
52
53
54
55
<section id="posts" class="posts-collapse" hidden>
<span class="archive-move-on"></span>
<span class="archive-page-counter">
{% assign posts_length = site.posts.size %}
{% if posts_length > 210 %} {% assign cheers = 'excellent' %}
{% elsif posts_length > 130 %} {% assign cheers = 'great' %}
{% elsif posts_length > 80 %} {% assign cheers = 'good' %}
{% elsif posts_length > 50 %} {% assign cheers = 'nice' %}
{% elsif posts_length > 30 %} {% assign cheers = 'ok' %}
{% else %}
{% assign cheers = 'um' %}
{% endif %}
{{ __.cheers[cheers] }}!
{% if site.posts.size == 0 %}
{{ __.counter.archive_posts.zero }}
{% elsif site.posts.size == 1 %}
{{ __.counter.archive_posts.one }}
{% else %}
{{ __.counter.archive_posts.other | replace: '%d', site.posts.size }}
{% endif %}
{{ __.keep_on }}
</span>
{% assign paginate = site.archive.paginate | default: site.paginate %}
{% assign paginate_path = site.archive.paginate_path | default: site.paginate_path %}
{% for post in site.posts %}
{% if paginate > 0 %}
{% assign page_num = forloop.index0 | divided_by: paginate | plus: 1 %}
{% if page_num == 1 %}
{% assign route = '/' %}
{% else %}
{% assign route = paginate_path | replace: ':num', page_num %}
{% endif %}
{% assign index0_modulo_paginate = forloop.index0 | modulo: paginate %}
{% endif %}
{% comment %} Show year {% endcomment %}
{% assign post_year = post.date | date: '%Y' %}
{% if post_year != year or index0_modulo_paginate == 0 and index0_modulo_paginate %}
{% assign year = post_year %}
<div class="collection-title" {% if route %}route="{{ route }}"{% endif %}>
<h2 class="archive-year motion-element" id="archive-year-{{ year }}">{{ year }}</h2>
</div>
{% endif %}
{% comment %} endshow {% endcomment %}
{% include _macro/post-collapse.html %}
{% endfor %}
</section>
<nav class="pagination"></nav>