Merge pull request #4611 from jekyll/draft-time-source-mtime
Merge pull request 4611
This commit is contained in:
commit
9b889217fa
|
@ -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