{% macro paginate(objects, route, route_args) %}
    <div class="pagination">
        {% if objects.has_prev %}
            <a href="{{ _url_for(route, route_args, page=objects.prev_num) }}">Page précédente</a> |
        {% endif %}

        {% for page in objects.iter_pages(1, 5, 6, 1) %}
            {% if page != objects.page %}
                <a href="{{ _url_for(route, route_args, page=page) }}">{{ page }}</a>
            {% else %}
                <strong>{{ page }}</strong>
            {% endif %}
        {% endfor %}

        {% if objects.has_next %}
            | <a href="{{ _url_for(route, route_args, page=objects.next_num) }}">Page suivante</a>
        {% endif %}
    </div>
{% endmacro %}
