From 2dd1fcfb0c40428005a271c1ae91cfe473fc3f73 Mon Sep 17 00:00:00 2001 From: Starnakin Date: Tue, 6 May 2025 18:55:14 +0200 Subject: [PATCH] add: bulk --- src/main.py | 21 +++++++++++++-------- src/templates/album.jinja | 2 +- src/templates/page.jinja | 2 +- 3 files changed, 15 insertions(+), 10 deletions(-) diff --git a/src/main.py b/src/main.py index 9459eb8..f1a5af9 100644 --- a/src/main.py +++ b/src/main.py @@ -69,20 +69,25 @@ def create_albums(albums: list[Album]) -> None: album.create() bar.next() - -def main(): - site_path = Path(argument_parsing()) - pages: list[Page] = scan_pages(site_path.get_dirs()) - shutil.copy2("./src/templates/page.css", site_path.get_absolute_path()) +def gen_bulk(bulk_path: Path): + pages: list[Page] = scan_pages(bulk_path.get_dirs()) + shutil.copy2("./src/templates/page.css", bulk_path.get_absolute_path()) create_pages(pages) - album_path: Path = Path(site_path, "albums") + album_path: Path = Path(bulk_path, "albums") if (not album_path.exist()): album_path.create() albums: list[Album] = scan_albums(pages, album_path) create_albums(albums) if config.CREATE_GENERAL_ALBUM: - shutil.move(os.path.join(album_path.get_absolute_path(), "general.html"), os.path.join(site_path.get_absolute_path(), "index.html")) - shutil.copy2("./src/templates/album.css", site_path.get_absolute_path()) + shutil.move(os.path.join(album_path.get_absolute_path(), "general.html"), os.path.join(bulk_path.get_absolute_path(), "index.html")) + shutil.copy2("./src/templates/album.css", bulk_path.get_absolute_path()) + + + +def main(): + site_path = Path(argument_parsing()) + gen_bulk(Path(site_path, "bulk")) + if __name__ == "__main__": main() diff --git a/src/templates/album.jinja b/src/templates/album.jinja index d19a8ae..d4d45af 100644 --- a/src/templates/album.jinja +++ b/src/templates/album.jinja @@ -2,7 +2,7 @@ - + diff --git a/src/templates/page.jinja b/src/templates/page.jinja index d06e3bc..a6ec517 100644 --- a/src/templates/page.jinja +++ b/src/templates/page.jinja @@ -2,7 +2,7 @@ - +