Explore how to loop over collections

This commit is contained in:
Adam Schmideg 2019-02-18 13:48:23 +01:00
parent b849a22374
commit c19f9db91c
2 changed files with 16 additions and 1 deletions

View file

@ -13,3 +13,10 @@ defaults:
path: docs
values:
layout: sidebar
collections_dir: docs
collections:
Mobile:
output: true
caption: Mobile-related
sidebar: true

View file

@ -1,6 +1,14 @@
---
layout: default
---
{% for coll in site.collections %}
{% if coll.sidebar %}
<h2>{{ coll.caption }}</h2>
{% for page in coll.docs %}
<h3>{{ page.title | remove_first: coll.label | remove_first: '/ '}}</h3>
{% endfor %}
{% endif %}
{% endfor %}
<div class="container" style="padding-top: 24px;">
<div class="row">
<div class="col-md-3" id="toc" style="padding-top: 16px;">