add: bulk
This commit is contained in:
parent
8c2d5df0d2
commit
2dd1fcfb0c
21
src/main.py
21
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()
|
||||
|
@ -2,7 +2,7 @@
|
||||
<html>
|
||||
|
||||
<head>
|
||||
<link rel="stylesheet" href="/album.css">
|
||||
<link rel="stylesheet" href="/bulk/album.css">
|
||||
</head>
|
||||
|
||||
<body>
|
||||
|
@ -2,7 +2,7 @@
|
||||
<html>
|
||||
|
||||
<head>
|
||||
<link rel="stylesheet" href="/page.css">
|
||||
<link rel="stylesheet" href="/bulk/page.css">
|
||||
</head>
|
||||
|
||||
<body>
|
||||
|
Loading…
Reference in New Issue
Block a user