diff --git a/tripyview/sub_tripyrun.py b/tripyview/sub_tripyrun.py index 1e6e6c55..0e4269bd 100644 --- a/tripyview/sub_tripyrun.py +++ b/tripyview/sub_tripyrun.py @@ -254,7 +254,12 @@ def tripyrun(): webpages["general"] = {} webpages["general"]["name"] = yaml_settings["tripyrun_name"] webpages["logo"] = {} - webpages["logo"]["path"] =os.path.join(templates_path, 'fesom2_logo.png') + # Copy logo to output directory and use relative path + logo_src = os.path.join(templates_path, 'fesom2_logo.png') + logo_dst = os.path.join(save_path, 'fesom2_logo.png') + if os.path.exists(logo_src) and not os.path.exists(logo_dst): + shutil.copy(logo_src, logo_dst) + webpages["logo"]["path"] = './fesom2_logo.png' #___________________________________________________________________________ # loop over available diagnostics and run the one selected in the yaml file diff --git a/tripyview/sub_tripyrundriver.py b/tripyview/sub_tripyrundriver.py index eec9ae4b..0033a5c5 100644 --- a/tripyview/sub_tripyrundriver.py +++ b/tripyview/sub_tripyrundriver.py @@ -135,8 +135,11 @@ def exec_papermill(webpage, cnt, params_vname, exec_template='hslice'): else : webpage[f"image_{cnt}"]["variable"] = '' webpage[f"image_{cnt}"]["cnt"] = cnt webpage[f"image_{cnt}"]["name"] = str_all2 - webpage[f"image_{cnt}"]["path"] = os.path.join('./figures/', save_fname) - webpage[f"image_{cnt}"]["path_nb"] = os.path.join('./notebooks/', save_fname_nb) + # Compute relative paths from HTML location (save_path) to figure/notebook directories + fig_relpath = os.path.relpath(params_vname['tripyrun_spath_fig'], params_vname['save_path']) + nb_relpath = os.path.relpath(params_vname['tripyrun_spath_nb'], params_vname['save_path']) + webpage[f"image_{cnt}"]["path"] = os.path.join(f'./{fig_relpath}/', save_fname) + webpage[f"image_{cnt}"]["path_nb"] = os.path.join(f'./{nb_relpath}/', save_fname_nb) webpage[f"image_{cnt}"]["short_name"] = short_name cnt += 1