From 8ff34eb0735bb97342179441093d6ea5bce718f6 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Vladim=C3=ADr=20Vondru=C5=A1?= Date: Tue, 7 Nov 2017 18:09:03 +0100 Subject: [PATCH] template: deduplicate article footer markup. --- pelican-theme/templates/archives.html | 6 ++++-- pelican-theme/templates/article.html | 9 ++++++--- pelican-theme/templates/article_footer.html | 4 +--- pelican-theme/templates/base_blog_section.html | 6 ++++-- pelican-theme/templates/index.html | 6 ++++-- 5 files changed, 19 insertions(+), 12 deletions(-) diff --git a/pelican-theme/templates/archives.html b/pelican-theme/templates/archives.html index ded6964b..bc7f0fd7 100644 --- a/pelican-theme/templates/archives.html +++ b/pelican-theme/templates/archives.html @@ -24,8 +24,10 @@ {{ article.content }} {% endif %} - {% macro footer() %}{% include "article_footer.html" %}{% endmacro %} - {{ footer()|indent(8) }} + {% if not loop.first or articles_page.number != 1 %}
{% endif %} diff --git a/pelican-theme/templates/article.html b/pelican-theme/templates/article.html index febc2d2e..c948f4e7 100644 --- a/pelican-theme/templates/article.html +++ b/pelican-theme/templates/article.html @@ -69,7 +69,8 @@ @@ -82,8 +83,10 @@ {{ article.content -}} - {% macro footer() %}{% include "article_footer.html" %}{% endmacro %} - {{ footer()|indent(6) }} + {% endif %} {% endblock %} diff --git a/pelican-theme/templates/article_footer.html b/pelican-theme/templates/article_footer.html index 3b109206..077e2eba 100644 --- a/pelican-theme/templates/article_footer.html +++ b/pelican-theme/templates/article_footer.html @@ -1,3 +1 @@ - +

Posted {% if article.authors %}by {% for author in article.authors %}{{ author }}{% endfor %}{% endif %} on in {{ article.category }}{% if article.modified %}; updated {% endif %}.{% if article.tags %} Tags: {% for tag in article.tags %}{{ tag }}{% if not loop.last %}, {% endif %}{% endfor %}.{% endif %}

diff --git a/pelican-theme/templates/base_blog_section.html b/pelican-theme/templates/base_blog_section.html index 8072d378..142b5dd8 100644 --- a/pelican-theme/templates/base_blog_section.html +++ b/pelican-theme/templates/base_blog_section.html @@ -18,8 +18,10 @@
{% macro header() %}{% include "article_header.html" %}{% endmacro %} {{ header()|indent(8) }} - {% macro footer() %}{% include "article_footer.html" %}{% endmacro %} - {{ footer()|indent(8) }} +
+ {% macro footer() %}{% include "article_footer.html" %}{% endmacro %} + {{ footer()|indent(10) }} +
{% endfor %} {% if articles_page.has_other_pages() %} diff --git a/pelican-theme/templates/index.html b/pelican-theme/templates/index.html index ded6964b..bc7f0fd7 100644 --- a/pelican-theme/templates/index.html +++ b/pelican-theme/templates/index.html @@ -24,8 +24,10 @@ {{ article.content }} {% endif %} - {% macro footer() %}{% include "article_footer.html" %}{% endmacro %} - {{ footer()|indent(8) }} + {% if not loop.first or articles_page.number != 1 %}
{% endif %} -- 2.30.2