Add multi-level TOC to docs.html

This commit is contained in:
Daniel Rudolf 2015-10-10 01:02:45 +02:00
parent ef9d6fb89e
commit 3c20d418c6
2 changed files with 16 additions and 2 deletions

View file

@ -1,6 +1,9 @@
---
toc:
install: Install
install:
_title: Install
using-a-pre-bundled-release: Using a pre-bundled released
composer: Composer
run: Run
---

View file

@ -17,7 +17,18 @@ nav: 2
{% for doc in site.docs %}
{% for item in doc.toc %}
<li>
<a href="#{{ item[0] }}">{{ item[1] }}</a>
{% if item[1]._title %}
<a href="#{{ item[0] }}">{{ item[1]._title }}</a>
<ul>
{% for sub in item[1] %}
{% if sub[0] != "_title" %}
<li><a href="#{{ sub[0] }}">{{ sub[1] }}</a></li>
{% endif %}
{% endfor %}
</ul>
{% else %}
<a href="#{{ item[0] }}">{{ item[1] }}</a>
{% endif %}
</li>
{% endfor %}
{% endfor %}