|
|
|
|
|
|
|
|
gallery = { |
|
|
gallery = { |
|
|
"name": gallery_dir.name, |
|
|
"name": gallery_dir.name, |
|
|
"path": gallery_dir.path, |
|
|
"path": gallery_dir.path, |
|
|
"url": gallery_dir.name, |
|
|
|
|
|
|
|
|
"output_path": gallery_dir.name, |
|
|
|
|
|
"url": f"{gallery_dir.name}.html", |
|
|
"num_photos": len(photos), |
|
|
"num_photos": len(photos), |
|
|
"photos": photos, |
|
|
"photos": photos, |
|
|
"cover_photo": photos[cover_index], |
|
|
"cover_photo": photos[cover_index], |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
def generate_gallery_index(output_path, gallery): |
|
|
def generate_gallery_index(output_path, gallery): |
|
|
gallery_index_path = os.path.join(output_path, f"{gallery['name']}.html") |
|
|
|
|
|
|
|
|
gallery_index_path = os.path.join(output_path, f"{gallery['url']}") |
|
|
|
|
|
|
|
|
theme_path = os.path.join(os.curdir, THEME) |
|
|
theme_path = os.path.join(os.curdir, THEME) |
|
|
jinja_env = Environment( |
|
|
jinja_env = Environment( |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
def generate_gallery_dir(output_path, gallery): |
|
|
def generate_gallery_dir(output_path, gallery): |
|
|
gallery_output_path = os.path.join(output_path, gallery["name"]) |
|
|
|
|
|
|
|
|
gallery_output_path = os.path.join(output_path, gallery["output_path"]) |
|
|
if not os.path.isdir(gallery_output_path): |
|
|
if not os.path.isdir(gallery_output_path): |
|
|
os.mkdir(gallery_output_path) |
|
|
os.mkdir(gallery_output_path) |
|
|
|
|
|
|