From d778083daf81ccbe9c9e2c7ba98cda03affacf4b Mon Sep 17 00:00:00 2001 From: =?utf8?q?Vladim=C3=ADr=20Vondru=C5=A1?= Date: Sat, 9 Dec 2017 23:06:05 +0100 Subject: [PATCH] theme: make the archives page work without pagination set up. --- pelican-theme/templates/archives.html | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/pelican-theme/templates/archives.html b/pelican-theme/templates/archives.html index 28f5268e..8d0d5178 100644 --- a/pelican-theme/templates/archives.html +++ b/pelican-theme/templates/archives.html @@ -2,23 +2,26 @@ {% block head %} {{- super() -}} - {% if articles_page.has_previous() %} + {% if articles_page and articles_page.has_previous() %} {% endif %} - {% if articles_page.has_next() %} + {% if articles_page and articles_page.has_next() %} {% endif %} {% endblock head %} {% block content %}
- {% block content_title %} - {% endblock content_title %} - {% for article in articles_page.object_list %} + {% if articles_page %} + {% set article_list = articles_page.object_list %} + {% else %} + {% set article_list = articles %} + {% endif %} + {% for article in article_list %}
{% macro header() %}{% include "article_header.html" %}{% endmacro %} {{ header()|indent(8) }} - {% if loop.first and articles_page.number == 1 and + {% if loop.first and (not articles_page or articles_page.number == 1) and ((article.collapse_first is defined and article.collapse_first != 'True') or (article.collapse_first is not defined and not M_COLLAPSE_FIRST_ARTICLE)) %}
@@ -30,12 +33,12 @@ {% macro footer() %}{% include "article_footer.html" %}{% endmacro %} {{ footer()|indent(10) }} - {% if not loop.first or articles_page.number != 1 %} + {% if not loop.first or (articles_page and articles_page.number != 1) %}
{% endif %}
{% endfor %} - {% if articles_page.has_other_pages() %} + {% if articles_page and articles_page.has_other_pages() %} {% macro pagination() %}{% include 'pagination.html' %}{% endmacro %} {{ pagination()|indent(6) }} {% endif %} -- 2.30.2