From 743e01f231649529350edaff6728f1bce87eae27 Mon Sep 17 00:00:00 2001 From: Stephen McDonald Date: Thu, 29 Dec 2011 11:37:06 +1100 Subject: [PATCH] Fixed a change in Tumblr's API whereby photos no longer have a single URL field. --- lib/jekyll/migrators/tumblr.rb | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/jekyll/migrators/tumblr.rb b/lib/jekyll/migrators/tumblr.rb index 2a2a3034..cc318ca0 100644 --- a/lib/jekyll/migrators/tumblr.rb +++ b/lib/jekyll/migrators/tumblr.rb @@ -56,10 +56,10 @@ module Jekyll end when "photo" title = post["photo-caption"] - content = "" - unless post["photo-link-url"].nil? - content = "#{content}" - end + max_size = post.keys.map{ |k| k.gsub("photo-url-", "").to_i }.max + url = post["photo-url"] || post["photo-url-#{max_size}"] + content = "" + content = "#{content}" unless url.nil? when "audio" if !post["id3-title"].nil? title = post["id3-title"]