diff --git a/lib/jekyll/collection.rb b/lib/jekyll/collection.rb index 95e4c8a1..21351374 100644 --- a/lib/jekyll/collection.rb +++ b/lib/jekyll/collection.rb @@ -19,7 +19,7 @@ module Jekyll docs << doc end end - docs + docs.sort! end def directory diff --git a/lib/jekyll/document.rb b/lib/jekyll/document.rb index e637fbd1..23ee437e 100644 --- a/lib/jekyll/document.rb +++ b/lib/jekyll/document.rb @@ -1,5 +1,6 @@ module Jekyll class Document + include Comparable attr_reader :path, :site attr_accessor :content, :collection @@ -88,5 +89,9 @@ module Jekyll }) end + def <=>(anotherDocument) + path <=> anotherDocument.path + end + end end