Automatically collect all files in the doc folder

This commit is contained in:
Adam Schmideg 2019-02-21 12:56:43 +01:00
parent 757acae2fa
commit a86c62d658
3 changed files with 28 additions and 8 deletions

View file

@ -36,3 +36,7 @@ collections:
output: true
caption: Developers
sidebar_index: 5
doc:
output: true
caption: Other
sidebar_index: 6

View file

@ -7,6 +7,8 @@ layout: default
{% assign collections = site.collections | sort: "sidebar_index" %}
{% for coll in collections %}
{% if coll.sidebar_index %}
{% assign count = coll.docs | size %}
{% if count <= 5 %}
<div class="list-group">
<a class="list-group-item active">{{ coll.caption }}</a>
{% for doc in coll.docs %}
@ -15,6 +17,13 @@ layout: default
{% include title.html doc=doc coll=coll %}</a>
{% endfor %}
</div>
{% else %}
{% capture url %}../{{ coll.label }}{% endcapture %}
<div class="list-group">
<a class="list-group-item active"
href="{% include link.html url=url %}">{{ coll.caption }}</a>
</div>
{% endif %}
{% endif %}
{% endfor %}
</div>

7
doc.md Normal file
View file

@ -0,0 +1,7 @@
---
title: Other documents
---
{% for p in site.doc %}
* [{{ p.title }}]({% include link.html url=p.url %})
{% endfor %}