From 992c4a8e6f71334f6c1a422c3547fdc535e7c8c2 Mon Sep 17 00:00:00 2001 From: Brandon Dimcheff Date: Wed, 4 Mar 2009 01:24:52 -0500 Subject: [PATCH] prevented _posts from being copied to the destination directory --- lib/jekyll/site.rb | 4 ++-- test/test_generated_site.rb | 4 ++++ 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/lib/jekyll/site.rb b/lib/jekyll/site.rb index 9b96ee6e..66212314 100644 --- a/lib/jekyll/site.rb +++ b/lib/jekyll/site.rb @@ -112,8 +112,8 @@ module Jekyll # we need to make sure to process _posts *first* otherwise they # might not be available yet to other templates as {{ site.posts }} - if entries.include?('_posts') - entries.delete('_posts') + if directories.include?('_posts') + directories.delete('_posts') read_posts(dir) end [directories, files].each do |entries| diff --git a/test/test_generated_site.rb b/test/test_generated_site.rb index 0762d299..6e3e5f77 100644 --- a/test/test_generated_site.rb +++ b/test/test_generated_site.rb @@ -29,4 +29,8 @@ class TestGeneratedSite < Test::Unit::TestCase assert_equal 1, published.size assert_equal "published.html", published.first end + + def test_posts_directory_not_copied + assert !File.exist?(File.join(dest_dir, '_posts')) + end end