From ee2d53a36d6d02c02c81f8ba69f27034a4e95abf Mon Sep 17 00:00:00 2001 From: Kumi Date: Mon, 1 Jul 2024 12:12:39 +0200 Subject: [PATCH] feat: extend asset copying to include data directory Expanded the asset copying functionality to also handle the 'data' directory in addition to the 'assets' folder. This ensures that both static assets and data files are included in the output directory, streamlining the build process and ensuring all necessary resources are available in the generated static site. --- main.py | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/main.py b/main.py index 2155665..aed5419 100644 --- a/main.py +++ b/main.py @@ -129,11 +129,12 @@ def generate_static_site(development_mode=False): f.write(response) # Copy static assets - assets_src = pathlib.Path("assets") - assets_dst = output_dir / "assets" - if assets_dst.exists(): - shutil.rmtree(assets_dst) - shutil.copytree(assets_src, assets_dst) + for folder in ["assets", "data"]: + src = pathlib.Path(folder) + dst = output_dir / folder + if dst.exists(): + shutil.rmtree(dst) + shutil.copytree(src, dst) print("Static site generated successfully.")