about summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--web/blog/default.nix5
-rw-r--r--web/blog/fragments.nix8
-rw-r--r--web/blog/posts.nix10
3 files changed, 13 insertions, 10 deletions
diff --git a/web/blog/default.nix b/web/blog/default.nix
index bc7b9666f79b..1bc026bf2a8c 100644
--- a/web/blog/default.nix
+++ b/web/blog/default.nix
@@ -11,7 +11,7 @@ let
   post = struct "blog-post" {
     key = string; #
     title = string;
-    date = string; # *sigh*
+    date = int;
 
     # Path to the Markdown file containing the post content.
     content = path;
@@ -39,8 +39,7 @@ let
     ${lib.concatStringsSep "\n" (map (post:
       "cp ${fragments.renderPost post} $out/${post.key}.html"
     ) posts)}
-  ''; # '' (this line makes nix-mode happy :/)
-
+  '';
 in import ./nginx.nix (args // {
   inherit posts renderedBlog;
 })
diff --git a/web/blog/fragments.nix b/web/blog/fragments.nix
index 2c9127b7f713..4af642c01e24 100644
--- a/web/blog/fragments.nix
+++ b/web/blog/fragments.nix
@@ -51,9 +51,13 @@ let
   renderPost = post: runCommandNoCC "${post.key}.html" {} ''
     cat ${toFile "header.html" (header post.title)} > $out
 
-    # Write the actual post
+    # Write the post title & date
     echo '<article><h2 class="inline">${escape post.title}</h2>' >> $out
-    echo '<aside class="date">${post.date}</aside>' >> $out
+    echo '<aside class="date">' >> $out
+    date --date="@${toString post.date}" '+%Y-%m-%d' >> $out
+    echo '</aside>' >> $out
+
+    # Write the actual post through cheddar's about-filter mechanism
     cat ${post.content} | ${pkgs.tools.cheddar}/bin/cheddar --about-filter ${post.content} >> $out
     echo '</article>' >> $out
 
diff --git a/web/blog/posts.nix b/web/blog/posts.nix
index e6fb821f959f..164ffa142d5b 100644
--- a/web/blog/posts.nix
+++ b/web/blog/posts.nix
@@ -3,35 +3,35 @@
   {
     key = "reversing-watchguard-vpn";
     title = "Reverse-engineering WatchGuard Mobile VPN";
-    date = "2017-02-11";
+    date = 1486830338;
     content = ./posts/reversing-watchguard-vpn.md;
     oldKey = "1486830338";
   }
   {
     key = "make-object-t-again";
     title = "Make Object <T> Again!";
-    date = "2016-10-18";
+    date = 1476807384;
     content = ./posts/make-object-t-again.md;
     oldKey = "1476807384";
   }
   {
     key = "the-smu-problem";
     title = "The SMU-problem of messaging apps";
-    date = "2015-12-17";
+    date = 1450354078;
     content =./posts/the-smu-problem.md;
     oldKey = "1450354078";
   }
   {
     key = "sick-in-sweden";
     title = "Being sick in Sweden";
-    date = "2015-02-15";
+    date = 1423995834;
     content = ./posts/sick-in-sweden.md;
     oldKey = "1423995834";
   }
   {
     key = "nsa-zettabytes";
     title = "The NSA's 5 zettabytes of data";
-    date = "2013-07-31";
+    date = 1375310627;
     content = ./posts/nsa-zettabytes.md;
     oldKey = "1375310627";
   }