added 'laast aangepast' AND 'geschreven op'
This commit is contained in:
parent
4292cb42a7
commit
0fa066fb1b
2 changed files with 10 additions and 0 deletions
|
@ -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>
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue