-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.njk
executable file
·50 lines (44 loc) · 1.19 KB
/
index.njk
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
---
layout: default
pagination:
data: collections.posts
size: 10
alias: posts
reverse: true
permalink: "/{% if pagination.pageNumber > 0 %}archives/page{{ pagination.pageNumber + 1}}/{% endif %}"
---
<section>
{% for post in posts %}
<article>
<a href="{{ post.url }}">
<div class="img-container">
<img src="{{post.data.headerImg | imagePath }}">
</div>
<div class="title-container">
<h2>{{ post.data.title }}</h2>
<div class="post-meta">{{ post.date | postDate }}</div>
</div>
</a>
<section>
<P>{{ post.data.description }}</P>
<ul class="tags">
{% for tag in post.data.tags %}
<li><a href="/tags/{{tag | slugify}}/">{{tag}}</a></li>
{% endfor %}
</ul>
</section>
</article>
{% endfor %}
<section class="button-container">
{% if pagination.href.next %}
<a href="{{ pagination.href.next }}">
<button> ← Older</button>
</a>
{% endif %}
{% if pagination.href.previous %}
<a href="{{ pagination.href.previous }}">
<button>Newer →</button>
</a>
{% endif %}
</section>
</section>