chaostreff-alzey.de/_plugins/last-modified-date.rb

12 lines
334 B
Ruby
Raw Normal View History

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