Implement correct fix for issue 27

This commit is contained in:
exu 2023-08-03 16:57:09 +02:00
parent b28cc32748
commit 5327a1600e

View File

@ -1,5 +1,3 @@
{# {% import _self as self %} #}
{% macro toc_loop(items) %} {% macro toc_loop(items) %}
{% for item in items %} {% for item in items %}
{% set class = loop.first ? 'first' : loop.last ? 'last' : null %} {% set class = loop.first ? 'first' : loop.last ? 'last' : null %}
@ -7,7 +5,7 @@
<a href="{{ item.uri }}">{{ item.label }}</a> <a href="{{ item.uri }}">{{ item.label }}</a>
{% if item.children|length > 0 %} {% if item.children|length > 0 %}
<ul> <ul>
{{ self.toc_loop(item.children) }} {{ _self.toc_loop(item.children) }}
</ul> </ul>
{% endif %} {% endif %}
</li> </li>
@ -20,7 +18,7 @@
{% if table_of_contents is not empty %} {% if table_of_contents is not empty %}
<h4>{{ 'PLUGIN_PAGE_TOC.TABLE_OF_CONTENTS'|t }}</h4> <h4>{{ 'PLUGIN_PAGE_TOC.TABLE_OF_CONTENTS'|t }}</h4>
<ul> <ul>
{{ self.toc_loop(table_of_contents.children) }} {{ _self.toc_loop(table_of_contents.children) }}
</ul> </ul>
{% endif %} {% endif %}
</div> </div>