From 863643c7e8080c73a7968caabfc9c7e9b18c6b95 Mon Sep 17 00:00:00 2001 From: Matt Ginzton Date: Tue, 22 Jan 2013 09:27:17 -0800 Subject: [PATCH] Look for _posts directory relative to cwd, not relative to tumblr.rb. That's where we put it earlier, so that's where we'll find it now. This addresses part of issue #773 (subissue 3). --- lib/jekyll/migrators/tumblr.rb | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) 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|