forked from theme-next/hexo-theme-next
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy patharchive.swig
49 lines (40 loc) · 1.41 KB
/
archive.swig
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
{% extends '_layout.swig' %}
{% import '_macro/post-collapse.swig' as post_template with context %}
{% import '_macro/sidebar.swig' as sidebar_template with context %}
{% block title %}{{ __('title.archive') }} | {{ title }}{% endblock %}
{% block content %}
{#####################}
{### ARCHIVE BLOCK ###}
{#####################}
<div class="post-block">
<div class="posts-collapse">
{%- if theme.cheers %}
<div class="collection-title">
{%- set posts_length = site.posts.length %}
{%- if posts_length > 210 %}
{%- set cheers = 'excellent' %}
{% elif posts_length > 130 %}
{%- set cheers = 'great' %}
{% elif posts_length > 80 %}
{%- set cheers = 'good' %}
{% elif posts_length > 50 %}
{%- set cheers = 'nice' %}
{% elif posts_length > 30 %}
{%- set cheers = 'ok' %}
{% else %}
{%- set cheers = 'um' %}
{%- endif %}
<span class="collection-header">{{ __('cheers.' + cheers) }}! {{ _p("counter.archive_posts", site.posts.length) }} {{ __('keep_on') }}</span>
</div>
{%- endif %}
{{ post_template.render(page.posts) }}
</div>
</div>
{#########################}
{### END ARCHIVE BLOCK ###}
{#########################}
{% include '_partials/pagination.swig' %}
{% endblock %}
{% block sidebar %}
{{ sidebar_template.render(false) }}
{% endblock %}