Skip to content
Snippets Groups Projects
Commit 8c20576e authored by Emmanuel Godard's avatar Emmanuel Godard
Browse files

improving category listing

parent f5392cf1
No related branches found
No related tags found
No related merge requests found
......@@ -7,20 +7,20 @@
<section id="list">
<h2>{{ category }}</h2>
<ul>
{% set current = 0 %}
{% set ns = namespace(current = 0) %}
{% for article in articles_page.object_list %}
{% set period = article.date | strftime('%Y') %}
{% if period != current %}
<h3>{{ period }}</h3>
{% set current = period %}
{% endif %}
<li>
<time>{{ article.date|strftime('%d %b %Y') }}</time><span>&nbsp;&nbsp;</span>
<a href="{{ SITEURL }}/{{ article.url }}"><strong>{{ article.title }}</strong>
{{ article.author }}
</a>
</li>
{% endfor %}
{% set period = article.date | strftime('%Y') %}
{% if ns.current != period %}
<h3>{{ period }}</h3>
{% set ns.current = period %}
{% endif %}
<li>
<time>{{ article.date|strftime('%d %b') }}</time><span>&nbsp;&nbsp;</span>
<a href="{{ SITEURL }}/{{ article.url }}"><strong>{{ article.title }}</strong>
{{ article.author }}
</a>
</li>
{% endfor %}
</ul>
</section>
{% if articles_page.has_other_pages() %}
......
......@@ -6,7 +6,7 @@
<ul>
{% for article in articles_page.object_list %}
<li>
{% if NOT_FUTURE_ONLY or article.date.isocalendar() >= article.date.today().isocalendar() %}
{% if WITH_PAST_DATES_IN_INDEX or article.date.isocalendar() >= article.date.today().isocalendar() %}
<h2>
<time datetime="{{ article.date }}">{{ article.date|strftime('%d %b %Y') }}</time>
<a href="{{ SITEURL }}/{{ article.url }}" rel="bookmark"
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment