Merge pull request #1848 from afeld/sort-pages
This commit is contained in:
		
						commit
						94e96d325b
					
				|  | @ -175,6 +175,8 @@ module Jekyll | |||
|           static_files << StaticFile.new(self, self.source, dir, f) | ||||
|         end | ||||
|       end | ||||
| 
 | ||||
|       pages.sort_by!(&:name) | ||||
|     end | ||||
| 
 | ||||
|     # Read all the files in <source>/<dir>/_posts and create a new Post | ||||
|  |  | |||
|  | @ -154,6 +154,13 @@ class TestSite < Test::Unit::TestCase | |||
|       assert_equal @site.generators.sort_by(&:class).map{|g|g.class.priority}, @site.generators.map{|g|g.class.priority} | ||||
|     end | ||||
| 
 | ||||
|     should "sort pages alphabetically" do | ||||
|       stub.proxy(Dir).entries { |entries| entries.reverse } | ||||
|       @site.process | ||||
|       sorted_pages = %w(.htaccess about.html bar.html contacts.html deal.with.dots.html foo.md index.html index.html sitemap.xml symlinked-file) | ||||
|       assert_equal sorted_pages, @site.pages.map(&:name) | ||||
|     end | ||||
| 
 | ||||
|     should "read layouts" do | ||||
|       @site.read_layouts | ||||
|       assert_equal ["default", "simple", "post/simple"].sort, @site.layouts.keys.sort | ||||
|  |  | |||
		Loading…
	
		Reference in New Issue