From e94e24ffec1853c026565f91f73e69aafcebdb09 Mon Sep 17 00:00:00 2001 From: Alberto Paparelli Date: Thu, 17 Oct 2024 00:55:38 +0200 Subject: 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. --- templates/index.html | 4 ++-- 1 file 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 %}