site_opytex/theme/templates/partial/toctree.html

22 lines
720 B
HTML

<ul class="toctree">
{% for cat, articles in categories|sort %}
{% if article and article.category == cat %}
<li class="toctree-l1 current"><a href="{{ SITEURL }}/{{ cat.url }}">{{ cat | capitalize }}</a>
<ul>
{% for art in articles | sort(attribute="date") %}
{% if article == art %}
<li class="toctree-l2 current"><span>{{ art.title }}</span></li>
{% else %}
<li class="toctree-l2"><a href="{{ SITEURL }}/{{ art.url }}">{{ art.title }}</a></li>
{% endif %}
{% endfor %}
</ul>
</li>
{% else %}
<li class="toctree-l1"><a href="{{ SITEURL }}/{{ cat.url }}">{{ cat | capitalize }}</a>
{% endif %}
{% endfor %}
</ul>