{% set args = request.args.copy() %} {% set prev = [1, page - 1] | max %} {% set next = [total_pages, page + 1] | min %}