{% macro loop(page) %}
    {% for p in page.children.visible %}
        {% set current_page = (p.active or p.activeChild) ? 'active' : '' %}
        <li class="{{ current_page }}">
            <a href="{{ p.url }}">
                {% if p.header.icon %}<i class="fa fa-{{ p.header.icon }}"></i>{% endif %}
                {{ p.menu }}
            </a>
            {% if p.children.visible.count > 0 %}
                <ul>
                    {{ _self.loop(p) }}
                </ul>
            {% endif %}
        </li>
    {% endfor %}
{% endmacro %}

<div class="navigation">

  <div class="navigation-inner section-inner">

  <ul class="blog-menu">
    {% if theme_config.dropdown.enabled %}
        {{ _self.loop(pages) }}
    {% else %}
        {% for page in pages.children.visible %}
            {% set current_page = (page.active or page.activeChild) ? 'current' : '' %}
            <li class="{{ current_page }} current-menu-item">
                <a href="{{ page.url }}">
                    {{ page.menu }}
                </a>
            </li>
        {% endfor %}
    {% endif %}
    {% for mitem in site.menu %}
        <li class="menu-item menu-item-type-post_type menu-item-object-page ">
            <a href="{{ mitem.url }}">
                {{ mitem.text }}
            </a>
        </li>
    {% endfor %}
    {% if config.plugins.login.enabled and grav.user.username %}
        <li>{% include 'partials/login-status.html.twig' %}</li>
    {% endif %}
</ul>

{% include 'partials/simplesearch_searchbox.html.twig' %}

<div class="clear"></div>
</div>

</div>
