From 33e56abcf229cf72256787d20a0153e6185a9fc1 Mon Sep 17 00:00:00 2001 From: Profpatsch Date: Sat, 7 Aug 2021 18:57:24 +0200 Subject: fix(users/Profpatsch/blog): notes toplevel rendering MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The rendering of the notes/ template was done in a very roundabout way through the routing table before. Now it’s constructed directly. Change-Id: Iaa6157cc3f9a7e5e0ad81ab843efa988995666b2 Reviewed-on: https://cl.tvl.fyi/c/depot/+/3282 Tested-by: BuildkiteCI Reviewed-by: Profpatsch --- users/Profpatsch/blog/default.nix | 21 +++++++++++++++++---- 1 file changed, 17 insertions(+), 4 deletions(-) (limited to 'users/Profpatsch/blog/default.nix') diff --git a/users/Profpatsch/blog/default.nix b/users/Profpatsch/blog/default.nix index 9d22e7f770c5..2a4a558cd8bf 100644 --- a/users/Profpatsch/blog/default.nix +++ b/users/Profpatsch/blog/default.nix @@ -16,6 +16,14 @@ let bins.lowdown "-s" "-Thtml" "-o" "$out" note ]; + toplevel = [ + { + route = [ "notes" ]; + name = "Notes"; + page = router; + } + ]; + notes = [ { route = [ "notes" "preventing-oom" ]; @@ -29,8 +37,11 @@ let } ]; - router = lib.pipe notes [ + notesFullRoute = lib.pipe notes [ (map (x@{route, ...}: x // { route = mkRoute route; })) + ]; + + router = lib.pipe notesFullRoute [ (map (x: { name = x.route; value = me.netencode.gen.dwim x; @@ -48,13 +59,15 @@ let "redirfd" "-w" "1" "$out" ] ++ cmd); - index = runExeclineStdout "index" {} [ - "backtick" "-in" "TEMPLATE_DATA" [ cdbDumpNetencode router ] + index = runExeclineStdout "index" { + stdin = me.netencode.gen.dwim notesFullRoute; + } [ + "withstdinas" "-in" "TEMPLATE_DATA" "pipeline" [ bins.printf '' '' -- cgit 1.4.1