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
|
||||
when "photo"
|
||||
title = post["photo-caption"]
|
||||
content = "<img src=\"#{save_file(post["photo-url"])}\"/>"
|
||||
unless post["photo-link-url"].nil?
|
||||
content = "<a href=\"#{post["photo-link-url"]}\">#{content}</a>"
|
||||
end
|
||||
max_size = post.keys.map{ |k| k.gsub("photo-url-", "").to_i }.max
|
||||
url = post["photo-url"] || post["photo-url-#{max_size}"]
|
||||
content = "<img src=\"#{save_file(url)}\"/>"
|
||||
content = "<a href=\"#{url}\">#{content}</a>" unless url.nil?
|
||||
when "audio"
|
||||
if !post["id3-title"].nil?
|
||||
title = post["id3-title"]
|
||||
|
|
Loading…
Reference in New Issue