Merge pull request #510 from dsschult/write-static-once

Only copy the static/theme files once
This commit is contained in:
Simon Conseil
2024-02-28 17:27:47 +01:00
committed by GitHub
2 changed files with 6 additions and 1 deletions

View File

@@ -891,6 +891,7 @@ class Gallery:
if self.settings["write_html"]:
album_writer = AlbumPageWriter(self.settings, index_title=self.title)
album_writer.copy_theme_files()
album_list_writer = AlbumListPageWriter(
self.settings, index_title=self.title
)

View File

@@ -95,8 +95,12 @@ class AbstractWriter:
)
sys.exit(1)
# Copy the theme files in the output dir
self.theme_path = os.path.join(self.output_dir, "static")
def copy_theme_files(self):
"""Copy the theme files to the destination"""
self.logger.info("Copying the theme files to the output dir")
if os.path.isdir(self.theme_path):
shutil.rmtree(self.theme_path)