From 804c0b103857453dd8d0c78725dba17244badeac Mon Sep 17 00:00:00 2001 From: Jens Timmerman Date: Mon, 12 Oct 2020 23:47:58 +0200 Subject: [PATCH] only show date, not hours, show 'laast aangepast op' instead of geschreven op --- layouts/blogpost.erb | 2 +- lib/helpers/blog.rb | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/layouts/blogpost.erb b/layouts/blogpost.erb index 9b06796..6584e92 100644 --- a/layouts/blogpost.erb +++ b/layouts/blogpost.erb @@ -28,7 +28,7 @@ <% end %>
- Geschreven op <%= gitmtime %>
+ Laatst aangepast op <%= gitmtime %>
Leestijd: <%= reading_time @item %>
diff --git a/lib/helpers/blog.rb b/lib/helpers/blog.rb index 0adee5e..b122e9d 100644 --- a/lib/helpers/blog.rb +++ b/lib/helpers/blog.rb @@ -27,13 +27,13 @@ module BlogHelper end def gitmtime - # find file extension + # find file last modification time filepath=@item[:content_filename] - str=`git log -1 --format='%ci' -- #{filepath}` + str=`git log -1 --format=%cd --date=short -- #{filepath}` if str == "" return @item[:created_at] else - return DateTime.parse( str ) + return str end end end