We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 2610333 commit 45755deCopy full SHA for 45755de
lib/jekyll/algolia/overwrites/jekyll-document.rb
@@ -5,9 +5,10 @@ module Jekyll
5
class Document
6
# By default, Jekyll will set the current date (time of build) to any
7
# collection item. This will break our diff algorithm, so we monkey patch
8
- # this call to return nil if no date is defined instead.
+ # this call to return nil if no date is defined and the file is not a
9
+ # draft instead.
10
def date
- data['date'] || nil
11
+ data["date"] ||= (draft? ? source_file_mtime : nil)
12
end
13
14
0 commit comments