{% macro render_pager( 
	pagination, 
	fragment='', 
	prev=('<span aria-hidden="true">&larr;</span>Prev')|safe, 
	next=('Next<span aria-hidden="true">&rarr;</span>')|safe, 
	align=''
) %}

<nav aria-label="Page navigation">
  <ul
    class="pagination {% if align == 'center' %}justify-content-center{% elif align == 'right' %}justify-content-end{% endif %}">
    <li class="page-item {% if not pagination.has_prev %}disabled{% endif %}">
      <a class="page-link"
        href="{{ url_for(request.endpoint, page=pagination.prev_num, **kwargs) + fragment if pagination.has_prev else '#' }}">
        {{ prev }} </a>
    </li>
    <li class="page-item {% if not pagination.has_next %}disabled{% endif %}">
      <a class="page-link"
        href="{{ url_for(request.endpoint, page=pagination.next_num, **kwargs) + fragment if pagination.has_next else '#' }}">
        {{ next }} </a>
    </li>
  </ul>
</nav>

{% endmacro %}
