diff options
author | Vincent Ambo <mail@tazj.in> | 2021-12-01T09·32+0300 |
---|---|---|
committer | Vincent Ambo <mail@tazj.in> | 2021-12-01T09·37+0300 |
commit | 79681c9e219c8dd2cc6690b78fce6bb48dcd10e1 (patch) | |
tree | 72ae3caa83ab33ded3794e7de0ce70cf57d9008d /web | |
parent | c725f89d8b4ec6b1fb4e396c808e2d8c4e236747 (diff) |
fix(web/tvl/blog): Include only published posts in listings & feed r/3123
Change-Id: I76c9c2c5cc82c7d0f59f907b6f1abee92a92cbf7
Diffstat (limited to 'web')
-rw-r--r-- | web/blog/default.nix | 3 | ||||
-rw-r--r-- | web/tvl/default.nix | 5 |
2 files changed, 7 insertions, 1 deletions
diff --git a/web/blog/default.nix b/web/blog/default.nix index ec386a217766..2cabc09b5524 100644 --- a/web/blog/default.nix +++ b/web/blog/default.nix @@ -55,5 +55,8 @@ let in { inherit post toFeedEntry; inherit (fragments) renderPost; + + # Helper function to determine whether a post should be included in + # listings (on homepages, feeds, ...) includePost = post: !(fragments.isDraft post) && !(fragments.isUnlisted post); } diff --git a/web/tvl/default.nix b/web/tvl/default.nix index 4a3688bf3177..be0981eec2af 100644 --- a/web/tvl/default.nix +++ b/web/tvl/default.nix @@ -3,6 +3,7 @@ with depot.nix.yants; let + inherit (builtins) filter; inherit (pkgs) graphviz runCommandNoCC writeText; inherit (depot.web) atom-feed blog tvl; @@ -18,6 +19,8 @@ let ${graphviz}/bin/neato -Tsvg ${./tvl.dot} > $out ''; + publishedPosts = filter blog.includePost tvl.blog.posts; + feed = { id = "https://tvl.fyi/"; title = "TVL blog"; @@ -29,7 +32,7 @@ let href = "https://tvl.fyi/feed.atom"; }; - entries = map (blog.toFeedEntry tvl.blog.config) tvl.blog.posts; + entries = map (blog.toFeedEntry tvl.blog.config) publishedPosts; }; atomFeed = writeText "feed.atom" (atom-feed.renderFeed feed); |