<div id="toc" class="bs-sidebar hidden-print affix" role="complementary">
    <ul class="nav bs-sidenav">
        <li class="active">
            <a href="#document-title">{{ document.title }}</a>
        </li>
        {% for section_key, section in get_sections(document) %}
        <li>
            <a href="#{{ section_key }}">{{ section_key }}</a>
            <ul class="nav">
                {% for link_key, link in get_links(section) %}
                <li><a href="#{{ link_key }}">{{ link.title or link_key }}</a></li>
                {% endfor %}
            </ul>
        </li>
        {% endfor %}
    </ul>
</div>
