From cefe99bed22456553284053f946f3fca997da799 Mon Sep 17 00:00:00 2001 From: Parker Moore Date: Tue, 1 Apr 2014 23:18:18 -0400 Subject: [PATCH] Sort the docs based on path --- lib/jekyll/collection.rb | 2 +- lib/jekyll/document.rb | 5 +++++ 2 files changed, 6 insertions(+), 1 deletion(-) 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