Sorting by date

This commit is contained in:
Digital Studium 2023-10-14 13:52:02 +03:00
parent a42609c2e6
commit edd8fb9df1
3 changed files with 18 additions and 6 deletions

View File

@ -1,7 +1,9 @@
{% for section, urls in posts[language].items() %}
{% for date, sections in posts[language].items() %}
{% for section, urls in sections.items() %}
{% if section != "/" %}
{% for url, post in urls.items() %}
{% include "components/post_summary.j2" %}
{% endfor %}
{% endif %}
{% endfor %}
{% endfor %}

View File

@ -1,3 +1,7 @@
{% for url, post in posts[language][section].items() %}
{% for date, sections in posts[language].items() %}
{% if section in sections %}
{% for url, post in posts[language][date][section].items() %}
{% include "components/post_summary.j2" %}
{% endfor %}
{% endif %}
{% endfor %}

View File

@ -1,11 +1,17 @@
<div class="sidebar">
<section>
{% for section, urls in posts[language].items() %}
{% set sections_list = [] %}
{% for date, sections in posts[language].items() %}
{% for section, urls in sections.items() %}
{% if section != "/" %}
<p>
<a href="/{{ language}}/{{ section }}/">{{ translate(section, language) }} ({{ urls | length }})</a>
</p>
{% set sections_list = sections_list.append(section) %}
{% endif %}
{% endfor %}
{% endfor %}
{% for section in sections_list | unique %}
<p>
<a href="/{{ language}}/{{ section }}/">{{ translate(section, language) }}</a>
</p>
{% endfor %}
</section>
</div>