mirror of
https://github.com/SebastianStork/kita.git
synced 2026-01-21 14:31:35 +01:00
refactor: modify file structure to improve customizability
This commit is contained in:
parent
9b2e5a305c
commit
67b58641e5
16 changed files with 156 additions and 157 deletions
31
templates/partials/toc.html
Normal file
31
templates/partials/toc.html
Normal file
|
|
@ -0,0 +1,31 @@
|
|||
{% if page.toc %}<!---->
|
||||
<div class="block-bg mb-12 flex rounded-lg p-2 text-lg">
|
||||
<details>
|
||||
<summary class="cursor-pointer py-1 pl-4">
|
||||
<span>Table of Contents</span>
|
||||
</summary>
|
||||
<div class="px-2">
|
||||
<ul>
|
||||
{% for h1 in page.toc %}
|
||||
<li>
|
||||
<a class="no-underline hover:underline" href="{{ h1.permalink | safe }}"
|
||||
>{{ h1.title }}</a
|
||||
>
|
||||
{% if h1.children %}
|
||||
<ul>
|
||||
{% for h2 in h1.children %}
|
||||
<li>
|
||||
<a class="no-underline hover:underline" href="{{ h2.permalink | safe }}"
|
||||
>{{ h2.title }}</a
|
||||
>
|
||||
</li>
|
||||
{% endfor %}
|
||||
</ul>
|
||||
{% endif %}
|
||||
</li>
|
||||
{% endfor %}
|
||||
</ul>
|
||||
</div>
|
||||
</details>
|
||||
</div>
|
||||
{% endif %}
|
||||
Loading…
Add table
Add a link
Reference in a new issue