<commit_before>{# This file might seem a little complex, because of the high density of tags.
   It uses Twig macros and ternary selectors. Read up on them, if required:
   macros: http://twig.sensiolabs.org/doc/templates.html#macros
   ternary operators: http://twig.sensiolabs.org/doc/templates.html#other-operators
#}

{# Make sure the setting for the submenus is defined. #}
{% if withsubmenus is not defined %}
    {% set withsubmenus = true %}
{% endif %}

{# The 'recursive' macro, for inserting one menu item. If it has a submenu, it
   invokes itself to insert the items of the submenus. #}
{% macro display_menu_item(item, loop, extraclass, withsubmenus) %}
    {% from _self import display_menu_item %}
    {% spaceless %}
    <li class="index-{{ loop.index -}}
        {{ item.path|default('') == 'homepage' ? ' menu-text' -}}
        {{ loop.first ? ' first' -}}
        {{ loop.last ? ' last' -}}
        {{ (item.submenu|default(false) and withsubmenus) ? ' is-dropdown-submenu-parent' -}}
        {{ item|current ? ' active' }}">

        <a href="{{ item.link }}" title='{{ item[app.request.get('_locale')~'title']|default(item.title)|default('')|escape }}' class='{{ item.class|default('') }}'>
            {{- item[app.request.get('_locale')~'label']|default(item.label)|default('-') -}}
        </a>

        {% if item.submenu is defined and withsubmenus %}
            <ul class="menu submenu vertical" data-submenu>
                {% for submenu in item.submenu %}
                    {{ display_menu_item(submenu, loop) }}
                {% endfor %}
            </ul>
        {% endif %}
    </li>
    {% endspaceless %}
{% endmacro %}

{# Make the macro available for use #}
{% from _self import display_menu_item %}

{# The main menu loop: Iterates over the items, calling `display_menu_item` #}
<ul  class="menu vertical medium-horizontal {{ class|default('') }}" data-responsive-menu="accordion medium-dropdown">
{% for item in menu %}
    {% if item.label is defined %}
        {{ display_menu_item(item, loop, '', withsubmenus) }}
    {% endif %}
{% endfor %}
</ul>
<commit_msg>Fix #126<commit_after>{# This file might seem a little complex, because of the high density of tags.
   It uses Twig macros and ternary selectors. Read up on them, if required:
   macros: http://twig.sensiolabs.org/doc/templates.html#macros
   ternary operators: http://twig.sensiolabs.org/doc/templates.html#other-operators
#}

{# Make sure the setting for the submenus is defined. #}
{% if withsubmenus is not defined %}
    {% set withsubmenus = true %}
{% endif %}

{# The 'recursive' macro, for inserting one menu item. If it has a submenu, it
   invokes itself to insert the items of the submenus. #}
{% macro display_menu_item(item, loop, extraclass, withsubmenus) %}
    {% from _self import display_menu_item %}
    {% spaceless %}
    <li class="index-{{ loop.index -}}
        {{ item.path|default('') == 'homepage' ? ' menu-text' -}}
        {{ loop.first ? ' first' -}}
        {{ loop.last ? ' last' -}}
        {{ (item.submenu|default(false) and withsubmenus) ? ' is-dropdown-submenu-parent' -}}
        {{ item|current ? ' active' }}">

        <a href="{{ item.link }}" title='{{ item[app.request.get('_locale')~'title']|default(item.title|default(''))|escape }}' class='{{ item.class|default('') }}'>
            {{- item[app.request.get('_locale')~'label']|default(item.label)|default('-') -}}
        </a>

        {% if item.submenu is defined and withsubmenus %}
            <ul class="menu submenu vertical" data-submenu>
                {% for submenu in item.submenu %}
                    {{ display_menu_item(submenu, loop) }}
                {% endfor %}
            </ul>
        {% endif %}
    </li>
    {% endspaceless %}
{% endmacro %}

{# Make the macro available for use #}
{% from _self import display_menu_item %}

{# The main menu loop: Iterates over the items, calling `display_menu_item` #}
<ul  class="menu vertical medium-horizontal {{ class|default('') }}" data-responsive-menu="accordion medium-dropdown">
{% for item in menu %}
    {% if item.label is defined %}
        {{ display_menu_item(item, loop, '', withsubmenus) }}
    {% endif %}
{% endfor %}
</ul>

{'fraction_non_alphanumeric': 0.164334835190894, 'fraction_numerical': 0.0007114062129475931, 'mean_word_length': 2.9867674858223063, 'pattern_counts': {'":': 0, '<': 19, '<?xml version=': 0, '>': 19, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6072221', 'n_tokens_mistral': 1417, 'n_tokens_neox': 1300, 'n_words': 347}