Finalise la boucle du template de l'index.

This commit is contained in:
Florestan Bredow
2025-06-01 10:31:05 +02:00
parent 73ec7dec65
commit 0bb55dac74

View File

@@ -9,9 +9,20 @@
<body>
<h1>{{ title }}</h1>
<p id="intro">{{ presentation }}</p>
{%- set ns = namespace(cur_month="") -%}
{%- for key, page in pages.items()|sort(attribute='1.date', reverse = true) -%}
{%- set month = page.date.strftime('%Y-%m') -%}
{%- if ns.cur_month != month -%}
{%- if ns.cur_month != "" %}
</ul>
{%- endif%}
<h2>{{ month }}</h2>
<ul>
{% for key, page in pages.items()|sort(attribute='1.date', reverse = true) %}
<li>{{ page.date }} : <a href="./pages/{{ key }}.html">{{ page.title }}</a>{% endfor %}
{%- endif -%}
{%- set ns.cur_month = month %}
<li>{{ page.date.strftime('%d')}} : <a href="./pages/{{ key }}.html">{{ page.title }}</a>
{%- endfor %}
</ul>
</body>
</html>