-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtable-of-contents.njk
37 lines (34 loc) · 966 Bytes
/
table-of-contents.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
---
title: Table of contents
subtitle: List of all posts and projects in this blog.
layout: layouts/base.njk
paletteColor: 3
permalink: /table-of-contents/
eleventyExcludeFromCollections: true
---
{% block content %}
<main id="main" class="l-main l-spacing-l">
{% set categories = ['til', 'tutorials', 'projects'] %}
{% for category in categories %}
<h3>{{ category | capitalize }}</h3>
<table class="c-table">
<thead>
<tr>
<td><strong>ID</strong></td>
<td><strong>Title</strong></td>
<td><strong>URL</strong></td>
</tr>
</thead>
<tbody>
{%- for entry in collections.postsSortedByIds|filterByCategory(category) %}
<tr>
<td>{{ entry.data.id }}</td>
<td>{{ entry.data.title }}</td>
<td><a href="{{ global.siteUrl }}/{{ entry.data.permalink }}">{{ entry.data.permalink }}</a></td>
</tr>
{% endfor %}
</tbody>
</table>
{% endfor %}
</main>
{% endblock %}