{% macro pagination(total, current, url, nearbyPagesLimit = 4) %} {# Create "main_url" variable with link for the first page #} {% set foo = url|split('/') %} {% set foo = foo|slice(0, -1) %} {% set main_url = foo|join('/') ~ "/" %} {% apply spaceless %} {% if total > 1 %}