|
|
@@ -4,6 +4,8 @@ import os |
|
|
|
import shutil |
|
|
|
import re |
|
|
|
|
|
|
|
from operator import itemgetter |
|
|
|
|
|
|
|
from jinja2 import Environment, PackageLoader, select_autoescape |
|
|
|
|
|
|
|
from configuration import SITE_TITLE, THEME |
|
|
@@ -20,6 +22,7 @@ def list_galleries_in(path): |
|
|
|
if len(photos) == 0: |
|
|
|
continue |
|
|
|
|
|
|
|
photos.sort(key=itemgetter("name")) |
|
|
|
gallery = { |
|
|
|
"name": gallery_dir.name, |
|
|
|
"path": gallery_dir.path, |
|
|
@@ -100,10 +103,10 @@ def generate_gallery_dir(output_path, gallery): |
|
|
|
def main(): |
|
|
|
pictures_folder = os.path.join(os.curdir, PICTURES_DIR_NAME) |
|
|
|
galleries = list(list_galleries_in(pictures_folder)) |
|
|
|
|
|
|
|
if len(galleries) == 0: |
|
|
|
return |
|
|
|
|
|
|
|
galleries.sort(key=itemgetter("name")) |
|
|
|
output_path = generate_output_dir() |
|
|
|
generate_style(output_path) |
|
|
|
generate_index(output_path, galleries) |