diff options
Diffstat (limited to 'website/templates/page.html')
| -rw-r--r-- | website/templates/page.html | 34 |
1 files changed, 31 insertions, 3 deletions
diff --git a/website/templates/page.html b/website/templates/page.html index 90b269d..8c9a9f1 100644 --- a/website/templates/page.html +++ b/website/templates/page.html @@ -1,11 +1,39 @@ {% extends "base.html" %} -{% import "macros.html" as macros %} - {% block content %} <article> <h1>{{ page.title }}</h1> - {{ page.content | replace(from="<!-- toc -->", to=macros::toc() ) | safe }} + <div class="px-4 py-0.5 my-3 border-s-4 rounded-xl border-double"> + <nav> + <ul class="ml-0 list-none"> + {% for parent in page.toc %} + {% if parent.level == 2 %} + <li> + {#- -#} + <a href="{{ parent.permalink | safe }}">{{ parent.title }}</a> + {#- -#} + {% if parent.children %} + <ul class="my-0 ml-5 list-none"> + {% for child in parent.children %} + {% if child.level == 3 %} + <li> + {#- -#} + <a class="text-base" href="{{ child.permalink | safe }}">{{ child.title }}</a> + {#- -#} + </li> + {% endif %} + {% endfor %} + </ul> + {% endif %} + {#- -#} + </li> + {% endif %} + {% endfor %} + </ul> + </nav> + </div> + + {{ page.content | safe }} </article> {% endblock %} |
