From 50e79b2d042e91e016ca022e04c27f0b4f592437 Mon Sep 17 00:00:00 2001 From: William Carroll Date: Sat, 8 Jan 2022 19:09:48 -0800 Subject: fix(wpcarro/blog): Sort blog posts by date DESC Show the most recently published blog posts first. Change-Id: Iacc9b2964552e8c0327a05a85c4fc5cbc8741f09 Reviewed-on: https://cl.tvl.fyi/c/depot/+/4833 Reviewed-by: wpcarro Autosubmit: wpcarro Tested-by: BuildkiteCI --- users/wpcarro/website/blog/default.nix | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/users/wpcarro/website/blog/default.nix b/users/wpcarro/website/blog/default.nix index 0eca77d9be3e..4ccf200223ce 100644 --- a/users/wpcarro/website/blog/default.nix +++ b/users/wpcarro/website/blog/default.nix @@ -6,6 +6,7 @@ let inherit (builtins) hasAttr filter readFile; inherit (depot.web.blog) post includePost renderPost; inherit (depot.users.wpcarro.website) domain renderTemplate withBrand; + inherit (lib.lists) sort; config = { name = "bill and his blog"; @@ -13,7 +14,8 @@ let footer = ""; }; - posts = filter includePost (list post (import ./posts.nix)); + posts = sort (x: y: x.date > y.date) + (filter includePost (list post (import ./posts.nix))); rendered = pkgs.runCommandNoCC "blog-posts" {} '' mkdir -p $out -- cgit 1.4.1