about summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--users/tazjin/blog/fragments.nix3
-rw-r--r--users/tazjin/renderMarkdown.nix9
2 files changed, 11 insertions, 1 deletions
diff --git a/users/tazjin/blog/fragments.nix b/users/tazjin/blog/fragments.nix
index 978dfa2a23df..18f1c4e4c236 100644
--- a/users/tazjin/blog/fragments.nix
+++ b/users/tazjin/blog/fragments.nix
@@ -12,6 +12,7 @@
 let
   inherit (builtins) filter map hasAttr replaceStrings toFile;
   inherit (depot.third_party) runCommandNoCC writeText;
+  inherit (depot.users.tazjin) renderMarkdown;
 
   # Generate a post list for all listed, non-draft posts.
   isDraft = post: (hasAttr "draft" post) && post.draft;
@@ -87,7 +88,7 @@ let
     }
 
     # Write the actual post through cheddar's about-filter mechanism
-    cat ${post.content} | ${depot.tools.cheddar}/bin/cheddar --about-filter ${post.content} >> $out
+    cat ${renderMarkdown post.content} >> $out
     echo '</article>' >> $out
 
     cat ${toFile "footer.html" footer} >> $out
diff --git a/users/tazjin/renderMarkdown.nix b/users/tazjin/renderMarkdown.nix
new file mode 100644
index 000000000000..58f29c30e0f3
--- /dev/null
+++ b/users/tazjin/renderMarkdown.nix
@@ -0,0 +1,9 @@
+# Render a Markdown file to HTML.
+{ depot, ... }:
+
+with depot.nix.yants;
+
+defun [ path drv ] (file: depot.third_party.runCommandNoCC "${file}.rendered.html" {} ''
+  cat ${file} | ${depot.tools.cheddar}/bin/cheddar --about-filter ${file} > $out
+'')
+