Factor out sidebar entry construction
This makes it possible to reuse this logic in other modules as well,
preventing code duplication. While at it, move additional_sidebar
merging before the other entries (additional entries should go first,
since the other entries are mostly dev-only etc).
Patch by: Sverre Rabbelier
{% ifnotequal prev_start -1 %}<a href="{{ start_base_url }}&start={{ prev_start }}">‹ Previous</a>{% endifnotequal %}
{% for page in pages %}
<a {% ifequal page.number current_page %} class="ae-page-selected ae-page-number" {% endifequal %}
href="{{ start_base_url }}&start={{ page.start }}">{{ page.number }}</a>
{% endfor %}
{% ifnotequal next_start -1 %}<a href="{{ start_base_url }}&start={{ next_start }}">Next ›</a>{% endifnotequal %}