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).
This commit is contained in:
Matt Ginzton 2013-01-22 09:27:17 -08:00
parent adce57e9e1
commit 863643c7e8
1 changed files with 1 additions and 2 deletions

View File

@ -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|