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()
|
album.create()
|
||||||
bar.next()
|
bar.next()
|
||||||
|
|
||||||
|
def gen_bulk(bulk_path: Path):
|
||||||
def main():
|
pages: list[Page] = scan_pages(bulk_path.get_dirs())
|
||||||
site_path = Path(argument_parsing())
|
shutil.copy2("./src/templates/page.css", bulk_path.get_absolute_path())
|
||||||
pages: list[Page] = scan_pages(site_path.get_dirs())
|
|
||||||
shutil.copy2("./src/templates/page.css", site_path.get_absolute_path())
|
|
||||||
create_pages(pages)
|
create_pages(pages)
|
||||||
album_path: Path = Path(site_path, "albums")
|
album_path: Path = Path(bulk_path, "albums")
|
||||||
if (not album_path.exist()):
|
if (not album_path.exist()):
|
||||||
album_path.create()
|
album_path.create()
|
||||||
albums: list[Album] = scan_albums(pages, album_path)
|
albums: list[Album] = scan_albums(pages, album_path)
|
||||||
create_albums(albums)
|
create_albums(albums)
|
||||||
if config.CREATE_GENERAL_ALBUM:
|
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.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", site_path.get_absolute_path())
|
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__":
|
if __name__ == "__main__":
|
||||||
main()
|
main()
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
<html>
|
<html>
|
||||||
|
|
||||||
<head>
|
<head>
|
||||||
<link rel="stylesheet" href="/album.css">
|
<link rel="stylesheet" href="/bulk/album.css">
|
||||||
</head>
|
</head>
|
||||||
|
|
||||||
<body>
|
<body>
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
<html>
|
<html>
|
||||||
|
|
||||||
<head>
|
<head>
|
||||||
<link rel="stylesheet" href="/page.css">
|
<link rel="stylesheet" href="/bulk/page.css">
|
||||||
</head>
|
</head>
|
||||||
|
|
||||||
<body>
|
<body>
|
||||||
|
Loading…
Reference in New Issue
Block a user