Redo the table of contents dropdown, with new animation as well

This commit is contained in:
daudix
2024-09-17 04:02:44 +03:00
parent 543d1bf862
commit ed02e10c3a
6 changed files with 76 additions and 17 deletions

View File

@ -76,8 +76,26 @@
{%- if page.extra.toc -%}
<details id="toc">
<summary title="{{ macros_translate::translate(key='table_of_contents', default='Table of Contents', language_strings=language_strings) }}"><i class="icon"></i></summary>
<div>
{%- include "partials/toc.html" -%}
<div id="toc-dropdown">
<strong id="toc-dropdown-title">{{ macros_translate::translate(key="table_of_contents", default="Table of Contents", language_strings=language_strings) }}</strong>
<div id="toc-dropdown-container">
<ul>
{%- for h1 in page.toc -%}
<li>
<a href="{{ h1.permalink | safe }}">{{ h1.title }}</a>
{%- if h1.children -%}
<ul>
{%- for h2 in h1.children -%}
<li>
<a href="{{ h2.permalink | safe }}">{{ h2.title }}</a>
</li>
{%- endfor -%}
</ul>
{%- endif -%}
</li>
{%- endfor -%}
</ul>
</div>
</div>
</details>
{%- endif -%}