Merge pull request #4741 from jekyll/sortable-doc-drop
Merge pull request 4741
This commit is contained in:
commit
41c3dd4cde
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue