-
Notifications
You must be signed in to change notification settings - Fork 1
/
collectionList.html
43 lines (40 loc) · 1.92 KB
/
collectionList.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
34
35
36
37
38
39
40
41
42
43
{% capture site_categories %}{% for page in site.pages %}{% if page.url contains include.filter %}{% if include.unpublished == true or page.publish == true %}{% if page.category %}{{ page.category }}~{% endif %}{% for pc in page.categories %}{{ pc }}~{% endfor %}{% endif %}{% endif %}{% endfor %}{% endcapture %}
{% assign category_list_dups = site_categories | split:'~' | sort %}
{% capture site_categories_sorted %}{% for cat in category_list_dups %}{%if cat != prev %}{{ cat }}{% unless forloop.last %}~{% endunless %}{%assign prev = cat %}{% endif %}{% endfor %}{% endcapture %}
{% assign category_list = site_categories_sorted | split:'~' | sort %}
<ul>
{% for cat in category_list %}
{% if cat != "Formats" %}
<li>{{ cat }}
<ul>
{% assign sorted_pages = site.pages | sort:"name" %}
{% for page in sorted_pages %}
{% if page.url contains include.filter %}
{% if page.category == cat or page.categories contains cat %}
{% if include.unpublished == true or page.publish == true %}
<li>
<a href="{{ site.baseurl }}{{ page.url }}" {% if page.publish != true %} style="color: gray;"{% endif %}>{{ page.title }}</a>
<span class="badge badge-{{ page.status }}">{{ page.status }}</span>
</li>
{% endif %} <!-- published-p -->
{% endif %} <!-- matching-category -->
{% endif %} <!-- url filter -->
{% endfor %} <!-- page -->
</ul>
</li>
{% endif %} <!-- cat filter -->
{% endfor %} <!-- categories -->
{% for page in sorted_pages %}
{% if page.url contains include.filter %}
{% if page.categories.size > 0 or page.category %}
{% else %}
{% if include.unpublished == true or page.publish == true %}
<li>
<a href="{{ site.baseurl }}{{ page.url }}" {% if page.publish != true %} style="color: gray;"{% endif %}>{{ page.title }}</a>
<span class="badge badge-{{ page.status }}">{{ page.status }}</span>
</li>
{% endif %} <!-- published-p -->
{% endif %} <!-- matching-category -->
{% endif %} <!-- url filter -->
{% endfor %} <!-- page -->
</ul>