properly handle absolute paths

This commit is contained in:
rra 2020-01-27 10:16:55 +01:00
parent 57b7d4d793
commit d868d65c74

View File

@ -97,18 +97,15 @@ def generate_metadata(path, context):
if 'i18n_subsites' in plugins:
subsites = True
lang = context['DEFAULT_LANG']
general_output_path = output_path.replace(lang, '').strip('/')
siteurl = siteurl.replace(lang,'').strip('/')
general_output_path = output_path.replace(lang, '')
siteurl = context['main_siteurl']
media_size = 0
# enumerate all media displayed on the page
media, soup = get_media(path) #reuse the same soup to limit calculation
for m in media:
# filter out SITEURL to prevent trouble
#print(context['SITEURL'], m)
# join output path to file, need to strip any leading slash for os.path
if subsites:
file_name = m.replace(context['main_siteurl']+'/', '')