aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAhmed <ahmed@gumx.cc>2024-11-17 20:33:04 +0200
committerAhmed <ahmed@gumx.cc>2024-11-17 20:33:04 +0200
commitfd47940fee95cc45b6ca670f2c0baf99a5d0a508 (patch)
treedb50dfff88d0292008d2b7c2e5af3e9a6e313c41
parent5481a5d239dbd60ec4ad10c9c692fb0a273173a0 (diff)
parente94e24ffec1853c026565f91f73e69aafcebdb09 (diff)
fix: sort pages by date for both paginated and non-paginated views
Merge branch 'carpe-diem-fix/sort-pages-by-date' By [carpediem](github.com/carpe-diem) Updated the index.html template to ensure that both paginated and non-paginated pages are sorted by date in descending order (newest first). This change improves the user experience by displaying the most recent content at the top of the list, enhancing navigation and content discovery.
-rw-r--r--templates/index.html4
1 files changed, 2 insertions, 2 deletions
diff --git a/templates/index.html b/templates/index.html
index c44de41..9fa741a 100644
--- a/templates/index.html
+++ b/templates/index.html
@@ -5,9 +5,9 @@
{% if config.extra.list_pages %}
{% if paginator %}
-{% set pages = paginator.pages %}
+{% set pages = paginator.pages | sort(attribute="date") | reverse %}
{% else %}
-{% set pages = section.pages %}
+{% set pages = section.pages | sort(attribute="date") | reverse %}
{% endif %}
<ul>
{% for page in pages %}