From edd8fb9df19056f8251f5b3bab6c958421be7769 Mon Sep 17 00:00:00 2001 From: Digital Studium Date: Sat, 14 Oct 2023 13:52:02 +0300 Subject: [PATCH] Sorting by date --- templates/components/index.j2 | 4 +++- templates/components/section.j2 | 6 +++++- templates/components/sidebar.j2 | 14 ++++++++++---- 3 files changed, 18 insertions(+), 6 deletions(-) diff --git a/templates/components/index.j2 b/templates/components/index.j2 index 846ad34..4f09201 100644 --- a/templates/components/index.j2 +++ b/templates/components/index.j2 @@ -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 %} \ No newline at end of file diff --git a/templates/components/section.j2 b/templates/components/section.j2 index 1dd8a77..543db66 100644 --- a/templates/components/section.j2 +++ b/templates/components/section.j2 @@ -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 %} \ No newline at end of file diff --git a/templates/components/sidebar.j2 b/templates/components/sidebar.j2 index 3712eb3..17fdf7c 100644 --- a/templates/components/sidebar.j2 +++ b/templates/components/sidebar.j2 @@ -1,11 +1,17 @@ \ No newline at end of file