Document#date: drafts which have no date should use source file mtime

This commit is contained in:
Parker Moore 2016-02-29 15:46:11 -08:00
parent aa1b565228
commit ae228705b2
1 changed files with 5 additions and 1 deletions

View File

@ -68,7 +68,11 @@ module Jekyll
end
def date
data['date'] ||= site.time
data['date'] ||= (draft? ? source_file_mtime : site.time)
end
def source_file_mtime
@source_file_mtime ||= File.mtime(path)
end
# Returns whether the document is a draft. This is only the case if