diff --git a/lib/jekyll/migrators/tumblr.rb b/lib/jekyll/migrators/tumblr.rb index 0c6402ab..2a2a3034 100644 --- a/lib/jekyll/migrators/tumblr.rb +++ b/lib/jekyll/migrators/tumblr.rb @@ -110,6 +110,9 @@ module Jekyll site = Jekyll::Site.new(Jekyll.configuration({})) dir = File.join(File.dirname(__FILE__), "..") urls = Hash[posts.map { |post| + # Create an initial empty file for the post so that + # we can instantiate a post object. + File.open("_posts/tumblr/#{post[:name]}", "w") tumblr_url = URI.parse(post[:slug]).path jekyll_url = Jekyll::Post.new(site, dir, "", "tumblr/" + post[:name]).url redirect_dir = tumblr_url.sub(/\//, "") + "/"