|
|
@ -98,7 +98,7 @@ def create_post(post_dir, entry): |
|
|
|
with open(os.path.join(post_dir,'index.html'),'w') as f: #n.b. .html |
|
|
|
post = template.render(frontmatter=frontmatter, content=parsed_content) |
|
|
|
f.write(post) |
|
|
|
#print('created post for', entry.title, '({})'.format(entry.link)) |
|
|
|
print('created post for', entry.title, '({})'.format(entry.link)) |
|
|
|
|
|
|
|
def grab_media(post_directory, url): |
|
|
|
""" |
|
|
@ -117,6 +117,8 @@ def grab_media(post_directory, url): |
|
|
|
print('Downloaded cover image', image) |
|
|
|
return image |
|
|
|
return image |
|
|
|
elif os.path.exists(os.path.join(post_directory, image)): |
|
|
|
return image |
|
|
|
|
|
|
|
except Exception as e: |
|
|
|
print('Failed to download cover image', url) |
|
|
|