Fix pages not in categories

This commit is contained in:
Pk11 2020-12-23 00:14:12 -06:00
parent 5a372c0ec0
commit 24148f873c

View File

@ -32,24 +32,27 @@ layout: compress
<!-- First do the index -->
{% for item in items %}
{% if item.url contains "index.html" %}
<li class="{% unless item contains category %}li-bullet{% endunless %} {% if page.title == item.title %}fw-bold{% endif %}"><a href="{{ item.url }}">{{ item.title }}</a></li>
<li class="li-bullet {% if page.title == item.title %}fw-bold{% endif %}"><a href="{{ item.url }}">{{ item.title }}</a></li>
{% endif %}
{% endfor %}
{% assign noCat = items | where: "category", nil %}
{% for item in noCat %}
{% unless item.url contains "index.html" %}
<li class="li-bullet {% if page.title == item.title %}fw-bold{% endif %}"><a href="{{ item.url }}">{{ item.title }}</a></li>
{% endunless %}
{% endfor %}
<!-- Then the other pages -->
{% for cat in categories %}
<li>
<details {% if page.category contains cat %}open{% endif %}>
<summary>{{ cat }}</summary>
<ul>
{% for item in items %}
{% unless item.category contains cat%}
{% continue %}
{% endunless %}
{% if item.url contains "index.html" %}
{% continue %}
{% endif %}
<li class="{% if page.title == item.title %}fw-bold{% endif %}"><a href="{{ item.url }}">{{ item.title }}</a></li>
{% endfor %}
{% for item in items %}
{% unless item.category contains cat %}
{% continue %}
{% endunless %}
<li class="{% if page.title == item.title %}fw-bold{% endif %}"><a href="{{ item.url }}">{{ item.title }}</a></li>
{% endfor %}
</ul>
</details>
</li>