chiark / gitweb /
Update pagination Pelican template.
authorGuillaume Jacquemin <williamjcm@users.noreply.github.com>
Sun, 5 Jul 2020 11:12:05 +0000 (13:12 +0200)
committerVladimír Vondruš <mosra@centrum.cz>
Sat, 7 Nov 2020 16:38:52 +0000 (17:38 +0100)
The template was hardcoded for the default reversed date ordering of
articles.

pelican-theme/templates/pagination.html

index 42a8dc5c3218011bd2045e04922d1038c9cc8131..0674fe0abb1f0c4dba0660d40a9fee426afaa5e5 100644 (file)
@@ -1,7 +1,7 @@
 {% if DEFAULT_PAGINATION %}
 <div class="m-article-pagination">
-  {%- if articles_page.has_previous() %}<a href="{{ articles_previous_page.url|format_siteurl|e }}">&laquo; newer articles</a> | {% endif -%}
+  {%- if articles_page.has_previous() %}<a href="{{ articles_previous_page.url|format_siteurl|e }}">&laquo; {% if ARTICLE_ORDER_BY == "date" %}older{% else %}newer{% endif %} articles</a> | {% endif -%}
   page {{ articles_page.number }}
-  {%- if articles_page.has_next() %} | <a href="{{ articles_next_page.url|format_siteurl|e }}">older articles &raquo;</a>{% endif -%}
+  {%- if articles_page.has_next() %} | <a href="{{ articles_next_page.url|format_siteurl|e }}">{% if ARTICLE_ORDER_BY == "date" %}newer{% else %}older{% endif %} articles &raquo;</a>{% endif -%}
 </div>
 {% endif %}