From 80a0b1ea9189f11291560d877dae5917f1ef7860 Mon Sep 17 00:00:00 2001 From: valentin gagarin Date: Wed, 13 Nov 2024 15:24:41 +0100 Subject: [PATCH] sort news by date --- website/content/default.nix | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/website/content/default.nix b/website/content/default.nix index 6f1a0e20..88e07232 100644 --- a/website/content/default.nix +++ b/website/content/default.nix @@ -49,9 +49,14 @@ in # News - ${lib.concatStringsSep "\n" (map (article: '' - - ${article.date} [${article.title}](./${article}) - '') config.collections.news.entry)} + ${ + let + sorted = with lib; reverseList (sortOn (entry: entry.date) config.collections.news.entry); + in + lib.join "\n" (map (article: '' + - ${article.date} [${article.title}](./${article}) + '') sorted) + } ''; }; }