all repos — zola-bearblog @ 18a135696a6f5a02a641a16c2881a2694f26ce1a

Port of bear blog theme to zola

Merge pull request 'Upgrade to latest zola & Tera 2' (#41) from adidalal/zola-bearblog:tera-v2 into main Reviewed-on: https://codeberg.org/alinnow/zola-bearblog/pulls/41

Alin
commit

18a135696a6f5a02a641a16c2881a2694f26ce1a

parent

593a8bb3f16404389c85dcec544d6dc188ad3a39

1 file changed, 12 insertions(+), 0 deletions(-)

changed files
A templates/components/toc.html
@@ -0,0 +1,12 @@
+{% component table_of_contents(toc: array, max_level: integer = 6, ...rest) {"doc": "Renders table of contents recursively"} %} +<ul> + {%- for header in toc %} + <li> + <a href="{{ header.permalink | safe }}">{{ header.title }}</a> + {%- if header.children and header.level < max_level %} + {{ <table_of_contents toc={header.children} max_level={max_level} /> }} + {%- endif %} + </li> + {%- endfor %} +</ul> +{% endcomponent table_of_contents %}