From: Vladimír Vondruš Date: Wed, 11 Oct 2017 19:39:58 +0000 (+0200) Subject: theme: make the index page equivalent to archives if not overriden. X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~cjwatson/git?a=commitdiff_plain;h=7c6167d915145198e2c25f0925949cada1cfbd71;p=blog.git theme: make the index page equivalent to archives if not overriden. --- diff --git a/pelican-theme/templates/index.html b/pelican-theme/templates/index.html index ee6776e8..08589117 100644 --- a/pelican-theme/templates/index.html +++ b/pelican-theme/templates/index.html @@ -1,3 +1,39 @@ -{% extends "base.html" %} -{% block main %} -{% endblock %} +{% extends "base_blog.html" %} + +{% block head %} + {{- super() -}} + {% if articles_page.has_previous() %} + + {% endif %} + {% if articles_page.has_next() %} + + {% endif %} +{% endblock head %} + +{% block content %} +
+ {% block content_title %} + {% endblock content_title %} + {% for article in articles_page.object_list %} +
+ {% macro header() %}{% include "article_header.html" %}{% endmacro %} + {{ header()|indent(8) }} + {% if loop.first and articles_page.number == 1 %} +
+ +{{ article.content }} + + {% endif %} + {% macro footer() %}{% include "article_footer.html" %}{% endmacro %} + {{ footer()|indent(8) }} + {% if not loop.first or articles_page.number != 1 %} +
+ {% endif %} +
+ {% endfor %} + {% if articles_page.has_other_pages() %} + {% macro pagination() %}{% include 'pagination.html' %}{% endmacro %} + {{ pagination()|indent(6) }} + {% endif %} +
+{% endblock content %}