Merge pull request #4741 from jekyll/sortable-doc-drop

Merge pull request 4741
This commit is contained in:
jekyllbot 2016-04-06 17:14:28 -07:00
commit 41c3dd4cde
1 changed files with 7 additions and 0 deletions

View File

@ -20,6 +20,13 @@ module Jekyll
fallback_data['excerpt'].to_s
end
def <=>(other)
return nil unless other.is_a? DocumentDrop
cmp = self['date'] <=> other['date']
cmp = self['path'] <=> other['path'] if cmp.nil? || cmp == 0
cmp
end
private
def_delegator :@obj, :data, :fallback_data
end