-
Notifications
You must be signed in to change notification settings - Fork 12
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
v.3.2.1 sublevels not generated #27
Comments
I confirm that it is broken. Only the start level headers do show up in toc and I cannot use v3.2.1 because of broken characters issue. |
@lilian-pouliquen v.3.2.2 starts with {% import _self as self %}
{% macro toc_loop(items) %}
{% for item in items %}
... This does not work correctly (only generates one level) v.3.2.1 starts with {% macro toc_loop(items) %}
{% import _self as self %}
{% for item in items %}... This works correctly, so you could use the version of v.3.2.1 I noticed that completely removing {% macro toc_loop(items) %}
{% for item in items %}
{% set class = loop.first ? 'first' : loop.last ? 'last' : null %}
<li {% if class %}class="{{ class }}"{% endif %}>
<a href="{{ item.uri }}">{{ item.label }}</a>
{% if item.children|length > 0 %}
<ul>
{{ _self.toc_loop(item.children) }}
</ul>
{% endif %}
</li>
{% endfor %}
{% endmacro %}
{% if active or toc_config_var('active') %}
<div class="page-toc">
{% set table_of_contents = toc_items(page.content) %}
{% if table_of_contents is not empty %}
<h4>{{ 'PLUGIN_PAGE_TOC.TABLE_OF_CONTENTS'|t }}</h4>
<ul>
{{ _self.toc_loop(table_of_contents.children) }}
</ul>
{% endif %}
</div>
{% endif %} |
@awrog Thanks again! |
@awrog |
I have this problem with both 3.2.1 and 3.2.2 |
I confirm that it is wrong. |
After updating to grav-plugin-page-toc-3.2.2.zip the sublevels of my page are no longer displayed.
grav-plugin-page-toc-3.2.1
grav-plugin-page-toc-3.2.2
markdown of page
The text was updated successfully, but these errors were encountered: