Browse Source

properly handle absolute paths

master
rra 5 years ago
parent
commit
d868d65c74
  1. 7
      page_metadata.py

7
page_metadata.py

@ -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']+'/', '')

Loading…
Cancel
Save