about summary refs log tree commit diff stats
path: root/templates/macros.html
diff options
context:
space:
mode:
authorAlan Pearce2024-05-29 16:01:03 +0200
committerAlan Pearce2024-05-29 16:01:03 +0200
commit99423f57f79499f13d021970c1efb4529072006b (patch)
treeaab3b0280ba6eabddb8ce8589538f9efb080a271 /templates/macros.html
parentdea01a9d2d2853af740aff8d11f573a70e7c4962 (diff)
downloadzola-bearblog-99423f57f79499f13d021970c1efb4529072006b.tar.lz
zola-bearblog-99423f57f79499f13d021970c1efb4529072006b.tar.zst
zola-bearblog-99423f57f79499f13d021970c1efb4529072006b.zip
improve whitespace generation in output files
Diffstat (limited to 'templates/macros.html')
-rw-r--r--templates/macros.html14
1 files changed, 7 insertions, 7 deletions
diff --git a/templates/macros.html b/templates/macros.html
index 2ad23e6..571c6e0 100644
--- a/templates/macros.html
+++ b/templates/macros.html
@@ -1,12 +1,12 @@
-{% macro table_of_contents(toc, max_level) %}
+{%- macro table_of_contents(toc, max_level) %}
 <ul>
-  {% for header in toc %}
+  {%- for header in toc %}
     <li>
       <a href="{{ header.permalink | safe }}">{{ header.title }}</a>
-        {% if header.children and header.level < max_level %}
-          {{ self::table_of_contents(toc=header.children, max_level=max_level) }}
-        {% endif %}
+        {%- if header.children and header.level < max_level %}
+          {{- self::table_of_contents(toc=header.children, max_level=max_level) | indent() | safe() }}
+        {%- endif %}
     </li>
-  {% endfor %}
+  {%- endfor %}
 </ul>
-{% endmacro %}
+{%- endmacro %}