Merge commit 'd9b183f99826df630eedeae29f70005993da3d64' into cat

This commit is contained in:
Tom Preston-Werner 2009-01-23 14:27:59 -08:00
commit c274ed3592
4 changed files with 32 additions and 16 deletions

View File

@ -104,6 +104,8 @@ module Jekyll
entries = entries.reject do |e|
(e != '_posts') and ['.', '_'].include?(e[0..0]) unless ['.htaccess'].include?(e)
end
directories = entries.select { |e| File.directory?(File.join(base, e)) }
files = entries.reject { |e| File.directory?(File.join(base, e)) }
# we need to make sure to process _posts *first* otherwise they
# might not be available yet to other templates as {{ site.posts }}
@ -111,7 +113,7 @@ module Jekyll
entries.delete('_posts')
read_posts(dir)
end
[directories, files].each do |entries|
entries.each do |f|
if File.directory?(File.join(base, f))
next if self.dest.sub(/\/$/, '') == File.join(base, f)
@ -132,6 +134,7 @@ module Jekyll
end
end
end
end
# Constructs a hash map of Posts indexed by the specified Post attribute
#

View File

@ -0,0 +1,6 @@
---
layout: default
title: Categories
---
Categories _should_ work

View File

@ -0,0 +1,6 @@
---
layout: default
title: Categories
---
Categories _should_ work. Even if ordered after index.

View File

@ -11,6 +11,7 @@ class TestGeneratedSite < Test::Unit::TestCase
def test_site_posts_in_index
# confirm that {{ site.posts }} is working
puts @s.posts.size
assert @index.include?("#{@s.posts.size} Posts")
end