Merge pull request #671 from fzero/master

Rescue from import errors on Wordpress.com plugin.
This commit is contained in:
Parker Moore 2013-01-17 19:30:51 -08:00
commit 3bca5c3297
1 changed files with 12 additions and 5 deletions

View File

@ -52,11 +52,18 @@ module Jekyll
'meta' => metas
}
FileUtils.mkdir_p "_#{type}s"
File.open("_#{type}s/#{name}", "w") do |f|
f.puts header.to_yaml
f.puts '---'
f.puts item.at('content:encoded').inner_text
begin
FileUtils.mkdir_p "_#{type}s"
File.open("_#{type}s/#{name}", "w") do |f|
f.puts header.to_yaml
f.puts '---'
f.puts item.at('content:encoded').inner_text
end
rescue
puts "Couldn't import post!"
puts "Title: #{title}"
puts "Name/Slug: #{name}\n"
next
end
import_count[type] += 1