elf-notes/templates/components/right-sidebar.html

25 lines
721 B
HTML

{% if section %} {% set toc = section.toc %} {% else %} {% set toc = page.toc %} {% endif %}
<div class="docs-toc" aria-label="On-page navigation">
<div class="scrollable-sidebar">
<div class="page-links">
<h4>On this page</h3>
<nav id="TableOfContents">
<ul>
{% for h1 in toc %}
<li>
<a href="{{ h1.permalink | safe}}">{{ h1.title }}</a>
{% if h1.children %}
<ul>
{% for h2 in h1.children %}
<li><a href="{{ h2.permalink | safe }}">{{ h2.title }}</a></li>
{% endfor %}
</ul>
{% endif %}
</li>
{% endfor %}
</ul>
</nav>
</div>
</div>
</div>