diff options
author | William Carroll <wpcarro@gmail.com> | 2022-01-09T03·09-0800 |
---|---|---|
committer | clbot <clbot@tvl.fyi> | 2022-01-09T03·13+0000 |
commit | 50e79b2d042e91e016ca022e04c27f0b4f592437 (patch) | |
tree | 081b39b886c7b9e4bd7f29809f671f4cfcd20eae /users/wpcarro | |
parent | bae8e8d26cb7681b3856aad9f7dda4fd383d8702 (diff) |
fix(wpcarro/blog): Sort blog posts by date DESC r/3575
Show the most recently published blog posts first. Change-Id: Iacc9b2964552e8c0327a05a85c4fc5cbc8741f09 Reviewed-on: https://cl.tvl.fyi/c/depot/+/4833 Reviewed-by: wpcarro <wpcarro@gmail.com> Autosubmit: wpcarro <wpcarro@gmail.com> Tested-by: BuildkiteCI
Diffstat (limited to 'users/wpcarro')
-rw-r--r-- | users/wpcarro/website/blog/default.nix | 4 |
1 files changed, 3 insertions, 1 deletions
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 |