flexi-bot/docs/marlin/_layouts/category.html
2023-09-05 20:38:49 +02:00

48 lines
1.5 KiB
HTML

---
layout: default
---
{% if page.type %}
<div class="container" role="main">
<div class="row">
<div class="col-lg-12">
<h1>{{ page.type | replace: '-',' ' | capitalize }}</h1>
</div>
</div>
<div class="row">
<div class="col-lg-12">
<div class="list-group">
{%- assign list = '' | split: '|' %}
{%- for col in site.collections %}
{%- for doc in col.docs %}
{%- if doc.category %}
{%- for cat in doc.category %}
{%- if cat == page.type %}
{%- assign list = list | push: doc %}
{%- endif %}
{%- endfor %}
{%- endif %}
{%- endfor %}
{%- endfor %}
{%- if list.size > 0 %}
{%- assign list = list | sort: 'title' %}
{%- for doc in list -%}
<a href="{{ doc.url | prepend: site.baseurl }}" class="list-group-item">
<h4 class="list-group-item-heading">
<i class="fa fa-book" aria-hidden="true"></i> {{ doc.title }}</h4>
{%- if doc.description -%}
<p class="list-group-item-text">{{ doc.description }}</p>
{%- elsif doc.brief -%}
<p class="list-group-item-text">{{ doc.brief }}</p>
{%- endif -%}
</a>
{%- endfor %}
{%- else %}
<p>This category contains no items.</p>
{%- endif %}
</div>
</div>
</div>
</div>
{% endif %}