handle paths and extensions properly, fix #41
This commit is contained in:
parent
657ced1ceb
commit
0ecc0ecd3a
@ -138,9 +138,9 @@ def create_event_post(post_dir, event):
|
|||||||
for img in event_metadata["images"]:
|
for img in event_metadata["images"]:
|
||||||
|
|
||||||
# parse img url to safe local image name
|
# parse img url to safe local image name
|
||||||
img_name = img.split("/")[-1]
|
img_name = os.path.basename(img)
|
||||||
fn, ext = img_name.split(".")
|
fn, ext = os.path.splitext(img_name)
|
||||||
img_name = slugify(fn) + "." + ext
|
img_name = slugify(fn) + '.' + ext
|
||||||
|
|
||||||
local_image = os.path.join(post_dir, img_name)
|
local_image = os.path.join(post_dir, img_name)
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user