web/_includes/toc.html

17 lines
559 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 %}
2021-12-01 16:48:57 +03:00
<!-- BS-toc.js will be loaded at medium priority -->
<script src="{{ site.data.assets[origin].bootstrap-toc.js | relative_url }}"></script>
2021-12-01 16:48:57 +03:00
<div id="toc-wrapper" class="pl-0 pr-4 mb-5">
2022-10-18 22:53:47 +03:00
<div class="panel-heading pl-3 pt-2 mb-2">{{- site.data.locales[site.lang].panel.toc -}}</div>
2021-12-01 16:48:57 +03:00
<nav id="toc" data-toggle="toc"></nav>
</div>
{% endif %}