class Jekyll::Document

Overwriting the Jekyll::Document class

Public Instance Methods

date() click to toggle source

By default, Jekyll will set the current date (time of build) to any collection item. This will break our diff algorithm, so we monkey patch this call to return nil if no date is defined and the file is not a draft instead.

# File lib/jekyll/algolia/overwrites/jekyll-document.rb, line 10
def date
  data["date"] ||= (draft? ? source_file_mtime : nil)
end