-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.njk
More file actions
47 lines (43 loc) · 1.16 KB
/
Copy pathindex.njk
File metadata and controls
47 lines (43 loc) · 1.16 KB
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: layouts/home.njk
eleventyNavigation:
key: Home
order: 1
numberOfLatestPostsToShow: 10
---
<h1>Nami Writes</h1>
<p>Nami writes about stuff.</p>
{% set postsCount = collections.posts | length %} {% set latestPostsCount =
postsCount | min(numberOfLatestPostsToShow) %}
<h2>
Latest {{ latestPostsCount }} Post{% if latestPostsCount != 1 %}s{% endif %}
</h2>
{% set postslist = collections.posts | head(-1 * numberOfLatestPostsToShow) %}
{% set postslistCounter = postsCount %} {% include "postslist.njk" %} {% set
morePosts = postsCount - numberOfLatestPostsToShow %} {% if morePosts > 0 %}
<p>
{{ morePosts }} more post{% if morePosts != 1 %}s{% endif %} can be found in
<a href="/blog/">the archive</a>.
</p>
{% endif %} {# List every content page in the project #} {#
<ul>
{%- for entry in collections.all %}
<li>
<a href="{{ entry.url }}"
><code>{{ entry.url }}</code></a
>
</li>
{%- endfor %}
</ul>
#}
<h2>Tags</h2>
<ul class="tagList">
{% for tag in collections.all | getAllTags | filterTagList %} {% set tagUrl
%}/tags/{{
tag | slugify
}}/{% endset %}
<li>
<a href="{{ tagUrl }}" class="post-tag">{{ tag }}</a>
</li>
{% endfor %}
</ul>