<div class="col-2 p-0 m-0">
    <div class="border bg-content rounded-4 p-3 sticky-top">
        <span class="d-block fw-bold mb-1">Table of Contents</span>
        <ul class="m-0 ps-4">
            {% for toc_item in page.toc %}
            <li><a href="{{ toc_item.url }}">{{ toc_item.title }}</a></li>
            {% for toc_item_secondary in toc_item.children %}
            <li>
                <a href="{{ toc_item_secondary.url }}">{{ toc_item_secondary.title }}</a>
                {% if toc_item_secondary.children %}
                <ul class="m-0 ps-4">
                    {% for toc_item_tertiary in toc_item_secondary.children %}
                    <li>
                        <a href="{{ toc_item_tertiary.url }}">{{ toc_item_tertiary.title }}</a>
                    </li>
                    {% endfor %}
                </ul>
                {% endif %}
            </li>
            {% endfor %}
            {% endfor %}
        </ul>
    </div>
</div>