-
Notifications
You must be signed in to change notification settings - Fork 12
/
index.njk
48 lines (46 loc) · 1.36 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
---
eleventyComputed:
title: "{% if pagination.pageNumber > 0 %}Page {{ pagination.pageNumber + 1 }}{% else %}Homepage{% endif %}"
layout: layouts/base.njk
permalink: /{% if pagination.pageNumber > 0 %}page-{{ pagination.pageNumber + 1 }}/{% endif %}
pagination:
data: collections.post
size: 6
alias: posts
reverse: true
eleventyNavigation:
key: Home
weight: 0
---
<div class="container">
<div class="hero">
<h1>
{% if site.hero.title %}
{% if pagination.pageNumber != 0 %}Page {{ pagination.pageNumber + 1 }} | {% endif %}
{{ site.hero.title }}
{% else %}
{{ site.meta.title }}
{% endif %}
</h1>
<p class="hero__description">
{% if site.hero.description %}
{{ site.hero.description }}
{% else %}
{{ site.meta.description }}
{% endif %}
</p>
</div>
<h2 class="section-title">
Latest Posts
{%- if pagination.pageNumber != 0 %} - Page {{ pagination.pageNumber + 1 }}{% endif %}
</h2>
{% include "components/postslist.njk" %}
<div class="pagination">
{% if pagination.previous %}
<a href="{{ pagination.href.previous | url }}" class="pagination__prev">← Prev Page</a>
{% endif %}
{% if pagination.next %}
<a href="{{ pagination.href.next | url }}" class="pagination__next">Next Page →</a>
{% endif %}
</div>
</div>