lib/jekyll-import/importers/tumblr.rb in jekyll-import-0.3.0 vs lib/jekyll-import/importers/tumblr.rb in jekyll-import-0.4.0
- old
+ new
@@ -72,11 +72,11 @@
if content
if use_markdown
content = html_to_markdown content
content = add_syntax_highlights content if add_highlights
end
-
+
File.open("_posts/tumblr/#{post[:name]}", "w") do |f|
f.puts post[:header].to_yaml + "---\n" + content
end
end
end
@@ -93,15 +93,21 @@
content = "<a href=\"#{post["link-url"]}\">#{title}</a>"
unless post["link-description"].nil?
content << "<br/>" + post["link-description"]
end
when "photo"
- title = post["photo-caption"]
- content = if post["photo-link-url"].nil?
- "<a href=\"#{post["photo-link-url"]}\">#{content}</a>"
+ title = post["slug"].gsub("-"," ")
+ if post["photos"].size > 1
+ content = ""
+ post["photos"].each do |post_photo|
+ photo = fetch_photo post_photo
+ content << photo + "<br/>"
+ content << post_photo["caption"]
+ end
else
- fetch_photo post
+ content = fetch_photo post
end
+ content << "<br/>" + post["photo-caption"]
when "audio"
if !post["id3-title"].nil?
title = post["id3-title"]
content = post["audio-player"] + "<br/>" + post["audio-caption"]
else