web/_includes/toc.html

14 lines
414 B
HTML
Raw Normal View History

{% assign enable_toc = false %}
2021-12-01 16:48:57 +03:00
{% if site.toc and page.toc %}
{% if page.content contains '<h2' or page.content contains '<h3' %}
{% assign enable_toc = true %}
{% endif %}
{% endif %}
{% if enable_toc %}
<section id="toc-wrapper" class="d-none ps-0 pe-4">
<h2 class="panel-heading ps-3 mb-2">{{- site.data.locales[include.lang].panel.toc -}}</h2>
<nav id="toc"></nav>
</section>
2021-12-01 16:48:57 +03:00
{% endif %}