]> git.draconx.ca Git - homepage.git/blobdiff - Rules
Let's start a blog!
[homepage.git] / Rules
diff --git a/Rules b/Rules
index f3f1f0a197c6f67c3dec7d13a593beef126cf1da..a881607f9b3211cd296780c97a8bdf4678883a61 100644 (file)
--- a/Rules
+++ b/Rules
@@ -36,6 +36,17 @@ preprocess do
             item[:gitrev] = commit if item_source(item)
         end
     end
+
+    @items.find_all('/weblog/*.md').each do |item|
+        item[:kind] ||= 'article'
+    end
+
+    @items.each do |item|
+        item[:created_at] ||=
+            item[:published] || File.stat(item.raw_filename).mtime
+        item[:updated_at] ||=
+            item[:updated] || File.stat(item.raw_filename).mtime
+    end
 end
 
 postprocess do
@@ -165,8 +176,8 @@ compile '/**/*.scss' do
 end
 
 compile '/**/*' do
-  filter :copybin if @item.binary?
-  write @item.identifier.to_s
+    filter :copybin if @item.binary?
+    write @item.identifier.to_s
 end
 
 layout '/**/*.xsl', :xsl