From 16314ee4a25227380ed070dc27a9e2c421ba4ca4 Mon Sep 17 00:00:00 2001 From: zachgersh Date: Mon, 3 Jun 2013 22:52:40 -0700 Subject: [PATCH] New leaving empty layouts / posts dirs and empty index.html. --- lib/jekyll/commands/new.rb | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/lib/jekyll/commands/new.rb b/lib/jekyll/commands/new.rb index 7a2cefcc..0139c661 100644 --- a/lib/jekyll/commands/new.rb +++ b/lib/jekyll/commands/new.rb @@ -20,8 +20,15 @@ module Jekyll end if options[:blank] - files_to_clear = Dir.glob("#{new_blog_path}/**/*.*") - files_to_clear.each {|file| File.truncate("#{file}", 0)} + file_to_truncate = "#{new_blog_path}/index.html" + file_list = [Dir.glob("#{new_blog_path}/**/_layouts/*"), + Dir.glob("#{new_blog_path}/**/_posts/*")] + + FileUtils.rm_rf Dir.glob("#{new_blog_path}/**/css") + FileUtils.rm Dir.glob("#{new_blog_path}/**/_config.yml") + + FileUtils.rm_rf(file_list) + File.truncate(file_to_truncate, 0) end puts "New jekyll site installed in #{new_blog_path}."