about summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--users/wpcarro/website/blog/default.nix1
-rw-r--r--web/blog/fragments.nix8
2 files changed, 4 insertions, 5 deletions
diff --git a/users/wpcarro/website/blog/default.nix b/users/wpcarro/website/blog/default.nix
index 31b1c7df9c79..27541b0f39b4 100644
--- a/users/wpcarro/website/blog/default.nix
+++ b/users/wpcarro/website/blog/default.nix
@@ -11,6 +11,7 @@ let
   config = {
     name = "bill and his blog";
     baseUrl = "https://${domain}/blog";
+    staticUrl = "https://static.tvl.fyi/latest";
     footer = "";
   };
 
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 [ "<" ">" "&" "'" ] [ "&lt;" "&gt;" "&amp;" "&#39;" ];
 
-  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