2021-12-07 09:53:48 +03:00
|
|
|
{% assign enable_toc = false %}
|
2021-12-01 16:48:57 +03:00
|
|
|
{% if site.toc and page.toc %}
|
2021-12-07 09:53:48 +03:00
|
|
|
{% if page.content contains '<h2' or page.content contains '<h3' %}
|
|
|
|
{% assign enable_toc = true %}
|
|
|
|
{% endif %}
|
|
|
|
{% endif %}
|
|
|
|
|
|
|
|
{% if enable_toc %}
|
2023-03-15 21:56:54 +03:00
|
|
|
<div id="toc-wrapper" class="pl-0 pr-4 mb-5">
|
2023-05-06 02:22:29 +03:00
|
|
|
<div class="panel-heading pl-3 pt-2 mb-2">{{- site.data.locales[include.lang].panel.toc -}}</div>
|
2023-03-15 21:56:54 +03:00
|
|
|
<nav id="toc"></nav>
|
|
|
|
</div>
|
2021-12-07 09:53:48 +03:00
|
|
|
|
2023-03-15 21:56:54 +03:00
|
|
|
<!-- toc.js will be loaded at medium priority -->
|
|
|
|
<script src="{{ site.data.assets[origin].toc.js | relative_url }}"></script>
|
2021-12-01 16:48:57 +03:00
|
|
|
{% endif %}
|