Revert "added helper function to get modification time from git"
This commit is contained in:
parent
a3e0a5de85
commit
abd5257e48
3 changed files with 5 additions and 20 deletions
|
@ -9,7 +9,7 @@
|
|||
<meta name="twitter:label1" value="Author" />
|
||||
<meta name="twitter:data1" value="<%= @item[:author] %>" />
|
||||
<meta name="twitter:label2" value="Created at" />
|
||||
<meta name="twitter:data2" value="<%= gitmtime %>" />
|
||||
<meta name="twitter:data2" value="<%= @item[:created_at] %>" />
|
||||
<meta name="twitter:card" content="summary_large_image" />
|
||||
|
||||
<!-- Animate.css -->
|
||||
|
@ -31,8 +31,7 @@
|
|||
<% end %>
|
||||
<div class="details animated fadeInRight">
|
||||
<small>
|
||||
Geschreven op <%= gitctime %><br>
|
||||
Laatst aangepast op <%= gitmtime %><br>
|
||||
Geschreven op <%= item[:created_at] %><br>
|
||||
Leestijd: <%= reading_time @item %>
|
||||
</small>
|
||||
</div>
|
||||
|
|
|
@ -25,20 +25,4 @@ module BlogHelper
|
|||
</figure>
|
||||
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
|
||||
|
|
|
@ -52,10 +52,12 @@ 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/],
|
||||
academic_year: i.identifier.to_s[/\d-\d/],
|
||||
created_at: Date.parse(i[:created_at])
|
||||
)
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Reference in a new issue