diff --git a/lib/jekyll/migrators/tumblr.rb b/lib/jekyll/migrators/tumblr.rb index 8b717d5d..b44c0140 100644 --- a/lib/jekyll/migrators/tumblr.rb +++ b/lib/jekyll/migrators/tumblr.rb @@ -121,13 +121,12 @@ module Jekyll # site/posts to get the correct permalink format. def self.rewrite_urls_and_redirects(posts) 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 + jekyll_url = Jekyll::Post.new(site, ".", "", "tumblr/" + post[:name]).url redirect_dir = tumblr_url.sub(/\//, "") + "/" FileUtils.mkdir_p redirect_dir File.open(redirect_dir + "index.html", "w") do |f|