Finalise la boucle du template de l'index.
This commit is contained in:
@@ -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>
|
Reference in New Issue
Block a user