diff options
Diffstat (limited to 'web/blog/fragments.nix')
-rw-r--r-- | web/blog/fragments.nix | 8 |
1 files changed, 3 insertions, 5 deletions
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: '' <!DOCTYPE html> <head> <meta charset="utf-8"> @@ -61,8 +59,8 @@ let <hr> ''; - 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 '<article><h2 class="inline">${escape post.title}</h2>' >> $out |