forked from eduardoboucas/buildtimes
-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
47 lines (40 loc) · 1.5 KB
/
index.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
---
layout: default
---
{% assign posts = '' | split: '/' %}
{% for post in site.posts %}
{% if post.queued == null %}
{% assign posts = posts | push: post %}
{% endif %}
{% endfor %}
{% assign totalPages = site.posts | size | minus: 1 | divided_by: 9 %}
{% assign totalPagesRemainder = site.posts | size | minus: 1 | modulo: site.paginate %}
{% if totalPagesRemainder > 0 %}
{% assign totalPages = totalPages | plus: 1 %}
{% endif %}
<main id="main" role="main" class="main constrain" data-paginator-current="{{ paginator.page }}" data-paginator-total="{{ totalPages }}">
{% assign postsPerPage = site.paginate %}
{% if paginator.page == 1 %}
{% assign postsOffset = 0 %}
{% assign postsPerPage = postsPerPage | plus: 1 %}
{% else %}
{% assign postsOffset = paginator.page | minus: 1 | times: postsPerPage | plus: 1 %}
{% endif %}
{% for post in posts | offset: postsOffset | limit: postsPerPage %}
{% if forloop.first == true %}
{% if postsOffset == 0 %}
{% include partials/post-featured.html post=post %}
{% endif %}
<div class="js-posts">
{% if postsOffset != 0 %}
{% include partials/post-small.html post=post index=forloop.index page=paginator.page %}
{% endif %}
{% else %}
{% include partials/post-small.html post=post index=forloop.index page=paginator.page %}
{% if forloop.last == true %}
</div>
{% endif %}
{% endif %}
{% endfor %}
</main>
{% include partials/paginator.html paginator=paginator %}