Refactor TOC conditionals (#3358)

It inserts TOC if non provided and auto TOC is enabled for distill
layout
This commit is contained in:
Ali Faraji 2025-11-21 16:18:05 -05:00 committed by GitHub
parent cef2ac090c
commit 07a7af3db6
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -67,7 +67,7 @@
{% endif %}
<d-article>
{% if page.toc %}
{% if page.toc and page.toc.size > 0 %}
<d-contents>
<nav class="l-text figcaption">
<h3>Contents</h3>
@ -87,7 +87,16 @@
{% endfor %}
</nav>
</d-contents>
{% elsif page.toc == true %}
<d-contents>
<nav class="l-text figcaption">
<h3>Contents</h3>
{% toc %}
</nav>
</d-contents>
{% endif %}
{{ content }}
</d-article>