about summary refs log tree commit diff
path: root/users/wpcarro/website/blog/default.nix
diff options
context:
space:
mode:
authorWilliam Carroll <wpcarro@gmail.com>2021-12-28T00·17-0400
committerclbot <clbot@tvl.fyi>2021-12-28T00·20+0000
commitc05c6920ee4d15d5d32e1294319b68091bb7af3b (patch)
tree44f29fe19fdd8b119f49918d4e4a7f9a38ace09b /users/wpcarro/website/blog/default.nix
parente107311cb87fc219889f37f0c67cfea22b4a99e7 (diff)
fix(wpcarro/blog): Fix broken post links r/3484
TL;DR:
- copy rendered posts to $out/posts
- update postUrl attr
- remove unused attrs

Change-Id: I027c20d6244e4626128788ad9aa1f1aad7855f32
Reviewed-on: https://cl.tvl.fyi/c/depot/+/4723
Reviewed-by: wpcarro <wpcarro@gmail.com>
Autosubmit: wpcarro <wpcarro@gmail.com>
Tested-by: BuildkiteCI
Diffstat (limited to 'users/wpcarro/website/blog/default.nix')
-rw-r--r--users/wpcarro/website/blog/default.nix15
1 files changed, 6 insertions, 9 deletions
diff --git a/users/wpcarro/website/blog/default.nix b/users/wpcarro/website/blog/default.nix
index 713c42a83b33..7056b026a21a 100644
--- a/users/wpcarro/website/blog/default.nix
+++ b/users/wpcarro/website/blog/default.nix
@@ -34,15 +34,12 @@ let
 
   toPostHtml = post: readFile (pkgs.substituteAll {
     src = ./fragments/post.html;
-    postUrl = "${config.baseUrl}/${post.key}.html";
+    postUrl = "${config.baseUrl}/posts/${post.key}.html";
     postTitle = post.title;
     postDate = formatDate post.date;
   });
-in {
-  inherit posts rendered config;
-
-  root = pkgs.runCommandNoCC "wpcarros-blog" {} ''
-    mkdir -p $out
-    cp ${wpcarro.website.render postsHtml} $out/index.html
-  '';
-}
+in pkgs.runCommandNoCC "wpcarros-blog" {} ''
+  mkdir -p $out
+  cp ${wpcarro.website.render postsHtml} $out/index.html
+  cp -r ${rendered} $out/posts
+''