Class: Jekyll::Document

Inherits:
Object
  • Object
show all
Defined in:
lib/jekyll/algolia/overwrites/jekyll-document.rb

Overview

Overwriting the Jekyll::Document class

Instance Method Summary collapse

Instance Method Details

#dateObject

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.



10
11
12
# File 'lib/jekyll/algolia/overwrites/jekyll-document.rb', line 10

def date
  data["date"] ||= (draft? ? source_file_mtime : nil)
end