wiki/_layouts/wiki.html
2020-12-22 23:50:26 -06:00

79 lines
2.4 KiB
HTML

---
layout: compress
---
<!DOCTYPE html>
<html lang="{{ page.collection | default: "en-US" }}">
{% include head.html%}
<body>
<div class="content">
{% include nav.html %}
<main>
<div class="container-fluid main-content">
{% include language-alert.html %}
<div class="row pt-5">
<div class="col-sm-3">
<div class="rounded-3 border sidebar-container mb-3 p-3">
<!-- get category list -->
{% assign items = site[page.collection] | where: "section", page.section | sort_natural: "title" %}
{% for item in items %}
{% if item.category.first %}
{% assign list = item.category %}
{% else %}
{% assign list = item.category | split: "don't split, i just want an array. this shouldn't be in a string." %}
{% endif %}
{% assign categories = categories | concat: list %}
{% endfor %}
{% assign categories = categories | uniq | sort_natural %}
<ul class="list-unstyled">
<!-- 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>
{% endif %}
{% 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 %}
</ul>
</details>
</li>
{% endfor %}
{% if category %}
</ul>
</details>
</li>
{% endif %}
</ul>
</div>
</div>
<div class="col-sm-9">
<h1>{{ page.title }}</h1>
<hr>
{% include anchor-headings.html html=content anchorBody="<small>#</small>" anchorClass="header-anchor" %}
</div>
</div>
</div>
</main>
</div>
{% include footer.html %}
{% include common-js.html %}
</body>
</html>