From 8641ee16fd7d42dafb7945183b5dcc2c56ec6826 Mon Sep 17 00:00:00 2001 From: Birte Kristina Friesel Date: Sat, 15 Jun 2024 11:50:38 +0200 Subject: fix --cdn on detail pages --- bin/pyggle | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'bin') diff --git a/bin/pyggle b/bin/pyggle index 81df0f1..0a88a4a 100755 --- a/bin/pyggle +++ b/bin/pyggle @@ -943,6 +943,16 @@ if __name__ == "__main__": for thumbnail in thumbnails: with open(f"{base_dir}/share/html_detail_start", "r") as f: detail_html_start = f.read() + if args.cdn: + detail_html_start = detail_html_start.replace( + 'href=".data/css/', f'href="{args.cdn}/css/' + ) + detail_html_start = detail_html_start.replace( + 'src=".data/js/', f'src="{args.cdn}/js/' + ) + detail_html_start = detail_html_start.replace( + "path = '.data/css/'", f"path = '{args.cdn}/css/'" + ) with open(f"{base_dir}/share/html_detail_end", "r") as f: detail_html_end = f.read() for thumbnail in thumbnails: -- cgit v1.2.3