From 16bedfd7b5fc86b30f8ebb2356f7f6dd28afbfc2 Mon Sep 17 00:00:00 2001 From: Victor Date: Sat, 4 Nov 2017 18:33:53 +0100 Subject: [PATCH] modification du template suite a la modification du scope des variables jinja (ref https://stackoverflow.com/questions/9486393/jinja2-change-the-value-of-a-variable-inside-a-loop and https://github.com/pallets/jinja/issues/164) --- theme/templates/archives.html | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/theme/templates/archives.html b/theme/templates/archives.html index cd48357..aacb35e 100644 --- a/theme/templates/archives.html +++ b/theme/templates/archives.html @@ -34,12 +34,12 @@ Full archives of {{ SITENAME|striptags|e }} blog.
- {% set last_year = 0 %} + {% set last_year = {'lastyear': 0} %} {% for article in dates %} {% set year = article.date.strftime('%Y') %} - {%if last_year != year %} + {%if last_year.lastyear != year %}

{{ year }}

- {% set last_year = year %} + {% set _dummy = last_year.update({'lastyear': year}) %} {% endif %} {% set next_year = 0 %} {% if not loop.last %}