Skip to content

Commit 05aeec9

Browse files
authored
Merge pull request #283 from jekyll/tumblr-fix-file-issue
Merge pull request 283
2 parents eba3e03 + 8e769bf commit 05aeec9

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

lib/jekyll-import/importers/tumblr.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -213,12 +213,12 @@ def self.rewrite_urls_and_redirects(posts)
213213
urls = Hash[posts.map { |post|
214214
# Create an initial empty file for the post so that
215215
# we can instantiate a post object.
216+
File.write("_posts/tumblr/#{post[:name]}", "")
216217
tumblr_url = URI.parse(URI.encode(post[:slug])).path
217218
jekyll_url = if Jekyll.const_defined? :Post
218-
File.open("_posts/tumblr/#{post[:name]}", "w") { |f| f.puts }
219219
Jekyll::Post.new(site, Dir.pwd, "", "tumblr/" + post[:name]).url
220220
else
221-
Jekyll::Document.new(File.expand_path("tumblr/#{post[:name]}"), site: site, collection: site.posts).url
221+
Jekyll::Document.new(File.expand_path("_posts/tumblr/#{post[:name]}"), site: site, collection: site.posts).url
222222
end
223223
redirect_dir = tumblr_url.sub(/\//, "") + "/"
224224
FileUtils.mkdir_p redirect_dir

0 commit comments

Comments
 (0)