forked from github/pelican
Fix importing Tumblr photo caption
Besides each photo's caption, the general caption is also needed. While we're at it, also add a linefeed at the end of file.
This commit is contained in:
parent
00a1cbb6b8
commit
75263fa852
1 changed files with 3 additions and 0 deletions
|
|
@ -370,6 +370,7 @@ def tumblr2fields(api_key, blogname):
|
|||
else:
|
||||
fmtstr = '<img alt="%s" src="%s" />'
|
||||
content = '\n'.join(fmtstr % (photo.get('caption'), photo.get('original_size').get('url')) for photo in post.get('photos'))
|
||||
content += '\n\n' + post.get('caption')
|
||||
elif type == 'quote':
|
||||
if format == 'markdown':
|
||||
fmtstr = '\n\n— %s'
|
||||
|
|
@ -398,6 +399,8 @@ def tumblr2fields(api_key, blogname):
|
|||
title = post.get('question')
|
||||
content = '<p><a href="%s" rel="external nofollow">%s</a>: %s</p>\n%s' % (post.get('asking_name'), post.get('asking_url'), post.get('question'), post.get('answer'))
|
||||
|
||||
content = content.rstrip() + '\n'
|
||||
|
||||
yield (title, content, slug, date, post.get('blog_name'), [type], tags, format)
|
||||
|
||||
offset += len(posts)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue