-
Notifications
You must be signed in to change notification settings - Fork 2
/
list.html
34 lines (29 loc) · 899 Bytes
/
list.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
---
layout: default
title: Contents
---
<!-- all rovers -->
<div class="post">
<h2>All</h2>
<!-- list all pages -->
{% for page in site.rovers %}
<li>
<a href="{{ site.url }}/#{{ page.title }}">{{ page.title }}</a>
</li>
{% endfor %}
</div>
<!-- get all rovers categories -->
{% assign all_categories = site.rovers | map: 'categories' | uniq | sort %}
<!-- iterate over categories -->
{% for category in all_categories -%}
{% assign pages = site.rovers | where_exp: 'page', "page.categories contains category" %}
<div class="post">
<h2>{{ category | capitalize }}</h2>
<!-- list all pages -->
{% for page in pages %}
<li>
<a href="{{ site.url }}?categories={{ category }}#{{ page.title }}">{{ page.title }}</a>
</li>
{% endfor %}
</div>
{% endfor %}