{%- macro page(text, page, class = "") -%}
    <li class="page-item {{ class }}"><a class="page-link" href="{{ page.generateUrl() }}">{{ text }}</a></li>
{%- endmacro -%}

{% import _self as m %}

{% if paginator|length > 1 %}
    <nav aria-label="Page navigation">
        <ul class="pagination pagination-sm justify-content-center short">

            {% for i in range(10, 1) %}
                {%- if paginator.hasPage(current - i) -%}
                    {{ m.page(current - i, paginator.getPage(current - i) ) }}
                {%- endif -%}
            {%- endfor -%}
            <li class="active page-item"><span class="page-link">{{ current }}</span></li>
            {% for i in range(1,10) %}
                {%- if paginator.hasPage(current + i) -%}
                    {{ m.page(current + i, paginator.getPage(current + i) ) }}
                {%- endif -%}
            {%- endfor -%}

        </ul>
    </nav>
{% endif %}
