added 'laast aangepast' AND 'geschreven op'

This commit is contained in:
Jens Timmerman 2020-10-13 00:37:54 +02:00
parent 4292cb42a7
commit 0fa066fb1b
2 changed files with 10 additions and 0 deletions

View file

@ -28,6 +28,7 @@
<% end %>
<div class="details animated fadeInRight">
<small>
Geschreven op <%= gitctime %><br>
Laatst aangepast op <%= gitmtime %><br>
Leestijd: <%= reading_time @item %>
</small>

View file

@ -26,10 +26,19 @@ module BlogHelper
HTML
end
def gitctime
# find file last modification time
filepath=@item[:content_filename]
str=`git log --format=%cd --date=short -- #{filepath} | tail -1`
return Date.parse(str)
end
def gitmtime
# find file last modification time
filepath=@item[:content_filename]
str=`git log -1 --format=%cd --date=short -- #{filepath}`
return Date.parse(str)
end
end