From e3a66cbd5d0ffb2306b6fe2cd65b53a1dbd8394f Mon Sep 17 00:00:00 2001 From: William Carroll Date: Thu, 30 Jun 2022 12:48:48 -0700 Subject: fix(web/blog): Parameterize renderPost with staticUrl This was broken in my blog for way too long. Change-Id: I03c45c666d67006a4608a4b19d6167ab692e321d Reviewed-on: https://cl.tvl.fyi/c/depot/+/5905 Reviewed-by: wpcarro Reviewed-by: tazjin Autosubmit: wpcarro Tested-by: BuildkiteCI --- web/blog/fragments.nix | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) (limited to 'web/blog') diff --git a/web/blog/fragments.nix b/web/blog/fragments.nix index 4d08a76b84e9..8c78b2cc928b 100644 --- a/web/blog/fragments.nix +++ b/web/blog/fragments.nix @@ -11,15 +11,13 @@ let inherit (pkgs) runCommand writeText; inherit (depot.nix) renderMarkdown; - staticUrl = "https://static.tvl.fyi/${depot.web.static.drvHash}"; - # Generate a post list for all listed, non-draft posts. isDraft = post: (hasAttr "draft" post) && post.draft; isUnlisted = post: (hasAttr "listed" post) && !post.listed; escape = replaceStrings [ "<" ">" "&" "'" ] [ "<" ">" "&" "'" ]; - header = name: title: '' + header = name: title: staticUrl: '' @@ -61,8 +59,8 @@ let
''; - renderPost = { name, footer, ... }: post: runCommand "${post.key}.html" { } '' - cat ${writeText "header.html" (header name post.title)} > $out + renderPost = { name, footer, staticUrl ? "https://static.tvl.fyi/${depot.web.static.drvHash}", ... }: post: runCommand "${post.key}.html" { } '' + cat ${writeText "header.html" (header name post.title staticUrl)} > $out # Write the post title & date echo '

${escape post.title}

' >> $out -- cgit 1.4.1