Document#date: drafts which have no date should use source file mtime
This commit is contained in:
parent
aa1b565228
commit
ae228705b2
|
@ -68,7 +68,11 @@ module Jekyll
|
||||||
end
|
end
|
||||||
|
|
||||||
def date
|
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
|
end
|
||||||
|
|
||||||
# Returns whether the document is a draft. This is only the case if
|
# Returns whether the document is a draft. This is only the case if
|
||||||
|
|
Loading…
Reference in New Issue