aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlberto Paparelli <alberto@paparelli.com.ar>2024-10-17 00:55:38 +0200
committerAlberto Paparelli <alberto@paparelli.com.ar>2024-10-17 00:55:38 +0200
commite94e24ffec1853c026565f91f73e69aafcebdb09 (patch)
treedb50dfff88d0292008d2b7c2e5af3e9a6e313c41
parent5481a5d239dbd60ec4ad10c9c692fb0a273173a0 (diff)
Fix: Sort pages by date for both paginated and non-paginated views
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 %}