From dc9a1754d54aa9890bc6d3f9de856ba6d11579eb Mon Sep 17 00:00:00 2001 From: Vincent Ambo Date: Fri, 2 Apr 2021 15:40:41 +0200 Subject: fix(tazjin/homepage): Use most recent entry update time for feed This drops the annoying usage of builtins.currenTime, which means that my website stops constantly rebuilding. Change-Id: I44294b06588673846f473beb6533a5fa3410a1bd Reviewed-on: https://cl.tvl.fyi/c/depot/+/2767 Reviewed-by: tazjin Tested-by: BuildkiteCI --- users/tazjin/homepage/feed.nix | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'users/tazjin/homepage') diff --git a/users/tazjin/homepage/feed.nix b/users/tazjin/homepage/feed.nix index 3c0cc06f1044..40650f678ba1 100644 --- a/users/tazjin/homepage/feed.nix +++ b/users/tazjin/homepage/feed.nix @@ -4,8 +4,8 @@ with depot.nix.yants; let - inherit (builtins) map readFile sort; - inherit (lib) singleton; + inherit (builtins) map readFile sort foldl'; + inherit (lib) max singleton; inherit (pkgs) writeText; inherit (depot.users.tazjin) atom-feed blog renderMarkdown; @@ -37,12 +37,13 @@ let allEntries = (map postToEntry blog.posts) ++ (map pageEntryToEntry pageEntries); + mostRecentlyUpdated = foldl' max 0 (map (e: e.updated) allEntries); + feed = { id = "https://tazj.in/"; title = "tazjin's interblag"; subtitle = "my posts, projects and other interesting things"; - # TODO(tazjin): Take the most recently updated entry time instead. - updated = builtins.currentTime; + updated = mostRecentlyUpdated; rights = "© 2020 tazjin"; authors = [ "tazjin" ]; -- cgit 1.4.1