12 lines
334 B
Ruby
12 lines
334 B
Ruby
|
Jekyll::Hooks.register :pages, :pre_render do |page|
|
||
|
begin
|
||
|
# get the current post last modified time
|
||
|
modification_time = File.mtime( page.path )
|
||
|
|
||
|
# inject modification_time in post's datas.
|
||
|
page.data['last-modified-date'] = modification_time
|
||
|
rescue
|
||
|
page.data['last-modified-date'] = "1970-01-01"
|
||
|
end
|
||
|
end
|