Fixed a change in Tumblr's API whereby photos no longer have a single URL field.
This commit is contained in:
parent
3ab7658d1f
commit
743e01f231
|
@ -56,10 +56,10 @@ module Jekyll
|
||||||
end
|
end
|
||||||
when "photo"
|
when "photo"
|
||||||
title = post["photo-caption"]
|
title = post["photo-caption"]
|
||||||
content = "<img src=\"#{save_file(post["photo-url"])}\"/>"
|
max_size = post.keys.map{ |k| k.gsub("photo-url-", "").to_i }.max
|
||||||
unless post["photo-link-url"].nil?
|
url = post["photo-url"] || post["photo-url-#{max_size}"]
|
||||||
content = "<a href=\"#{post["photo-link-url"]}\">#{content}</a>"
|
content = "<img src=\"#{save_file(url)}\"/>"
|
||||||
end
|
content = "<a href=\"#{url}\">#{content}</a>" unless url.nil?
|
||||||
when "audio"
|
when "audio"
|
||||||
if !post["id3-title"].nil?
|
if !post["id3-title"].nil?
|
||||||
title = post["id3-title"]
|
title = post["id3-title"]
|
||||||
|
|
Loading…
Reference in New Issue