3685685b28
- Easy to switch between different CDN - Allow self-host static assets
16 lines
539 B
HTML
16 lines
539 B
HTML
{% assign enable_toc = false %}
|
|
{% 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 %}
|
|
<!-- BS-toc.js will be loaded at medium priority -->
|
|
<script src="{{ site.data.assets[origin].bootstrap-toc.js }}"></script>
|
|
|
|
<div id="toc-wrapper" class="pl-0 pr-4 mb-5">
|
|
<div class="panel-heading pl-3 pt-2 mb-2">{{- site.data.locales[lang].panel.toc -}}</div>
|
|
<nav id="toc" data-toggle="toc"></nav>
|
|
</div>
|
|
{% endif %}
|