diff --git a/lib/helpers/blog.rb b/lib/helpers/blog.rb index b122e9d..4b8be72 100644 --- a/lib/helpers/blog.rb +++ b/lib/helpers/blog.rb @@ -30,10 +30,6 @@ module BlogHelper # find file last modification time filepath=@item[:content_filename] str=`git log -1 --format=%cd --date=short -- #{filepath}` - if str == "" - return @item[:created_at] - else - return str - end -end + return Date.parse(str) + end end diff --git a/lib/helpers/preprocess.rb b/lib/helpers/preprocess.rb index 07ff4a9..9ecb2bc 100644 --- a/lib/helpers/preprocess.rb +++ b/lib/helpers/preprocess.rb @@ -52,12 +52,10 @@ module PreprocessHelper def update_blog_attributes @items.find_all('/blog/**/*.md').each do |i| - raise "#{i.identifier} doesn't have 'created_at'" unless i[:created_at] i.update_attributes( # Tag all posts with article (for Blogging helper) kind: 'article', academic_year: i.identifier.to_s[/\d\d-\d\d/], - created_at: Date.parse(i[:created_at]) ) end end