aboutsummaryrefslogtreecommitdiffstats
path: root/site/_includes/generated_index.html
blob: 630e7a112a472ddf294d9f57e99a3fcda1b2bfad (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
{% assign tocsdir = site.data.tocs %}
{% assign tocfile = tocsdir.[page.tocdir].[page.tocfile] %}

<div class="home">
    {% for entry in tocfile %}
        <h1>{{ entry.name }}</h1>
        <ul>
            {% for child in entry.children %}

            {% comment %}
            skip sub-sections; they'll get their own sections below
            {% endcomment %}
            {% if child.children %}{% continue %}{% endif %}

            <li>
                <h2><a href="{{ child.url }}">{{ child.name }}</a></h2>
                {% if child.description %}<span class="summary">{{ child.description }}</span>{% endif %}
            </li>
            {% endfor %}
        </ul>

        {% comment %}
        add sections for sub-sections
        {% endcomment %}
        {% for child in entry.children %}
            {% if child.children %}
                <h2>{{ child.name }}</h2>
                <ul>
                {% for grandchild in child.children %}
                <li>
                    <h2><a href="{{ grandchild.url }}">{{ grandchild.name }}</a></h2>
                    {% if grandchild.description %}<span class="summary">{{ grandchild.description }}</span>{% endif %}
                </li>
                {% endfor %}
                </ul>
            {% endif %}
        {% endfor %}
    {% endfor %}
</div>