{% macro links(pages, collection, active, options, depth) %}
    {% for page in pages %}

        {% set children = collection.children(page) %}

        <li class="
            {{ children.isEmpty() ? '' : (options.dropdown_class ?: 'dropdown') }}
            {{ collection.hasActive(page, active) ? options.get('has_active_class', 'active') }}
            {{ page.id == active.id ? options.get('active_class', 'active') }}
            {{ options.item_class }}">

            <a href="{{ url(page.path) }}">
                {{ page.title }}
            </a>

            {% if not children.isEmpty() %}
                {% if depth+1 <= options.get('depth', 999) %}
                    <ul class="{{ options.child_list_class }}">
                        {{ _self.links(children, collection, options, depth+1) }}
                    </ul>
                {% endif %}
            {% endif %}
        </li>
    {% endfor %}
{% endmacro %}

{% macro links(pages, collection, active, options, depth) %}
    {% for page in pages %}

        {% set children = collection.children(page) %}

        <{{ options.link_tag ?: 'li' }} class="
            {{ children.isEmpty() ? '' : (options.dropdown_class ?: 'dropdown') }}
            {{ collection.hasActive(page, active) ? options.get('has_active_class', 'active') }}
            {{ page.id == active.id ? options.get('active_class', 'active') }}
            {{ options.item_class }}">

            <a href="{{ url(page.path) }}" class="{{ options.link_class }}">
                {{ page.title }}
            </a>

            {% if not children.isEmpty() %}
                {% if depth+1 <= options.get('depth', 999) %}
                    <{{ options.child_list_tag ?: options.list_tag ?: 'ul' }} class="{{ options.child_list_class }}">
                        {{ _self.links(children, collection, options, depth+1) }}
                    </{{ options.child_list_tag ?: options.list_tag ?: 'ul' }}>
                {% endif %}
            {% endif %}
        </{{ options.link_tag ?: 'li' }}>
    {% endfor %}
{% endmacro %}

Add some more options for customizing page structure nav
Add some more options for customizing page structure nav