From 3831d57fe653609bb9a7837d1a7f95c4b837396a Mon Sep 17 00:00:00 2001 From: Starnakin Date: Sun, 1 Dec 2024 14:31:35 +0100 Subject: [PATCH] add: css --- src/main.py | 14 +++- src/templates/icons/file.png | Bin 0 -> 13040 bytes src/templates/page.css | 84 ++++++++++++++++++++++++ src/templates/{index.html => page.html} | 6 +- 4 files changed, 99 insertions(+), 5 deletions(-) create mode 100644 src/templates/icons/file.png create mode 100644 src/templates/page.css rename src/templates/{index.html => page.html} (86%) diff --git a/src/main.py b/src/main.py index 5896f27..f1df988 100644 --- a/src/main.py +++ b/src/main.py @@ -15,7 +15,7 @@ with open('config.json', 'r') as file: # Initialiser l'environnement avec un dossier de templates env = Environment(loader=FileSystemLoader('src/templates')) -template = env.get_template('index.html') +template = env.get_template('page.html') def get_files_recursive(directory): file_paths = [] @@ -63,7 +63,10 @@ def get_exif(raws: list[str]): def generate_page(output_path: str): - for folder in os.listdir(output_path): + folders = os.listdir(output_path) + if "general" in folders: + folders.remove("general") + for folder in folders: path = os.path.join(output_path, folder) if (os.path.isdir(path)): files: list[str] = [os.path.join(path, file) for file in os.listdir(path) if os.path.isfile(os.path.join(path, file))] @@ -72,6 +75,7 @@ def generate_page(output_path: str): larges = [file for ext in config["file_type_extensions"]["large"] for file in files if file.endswith(ext)] smalls = [file for ext in config["file_type_extensions"]["small"] for file in files if file.endswith(ext)] + print(folder) generate_missing_images(raws, larges, smalls) exif = get_exif(raws) @@ -79,6 +83,7 @@ def generate_page(output_path: str): large = os.path.basename(larges[0]) if len(larges) > 0 else None small = os.path.basename(smalls[0]) if len(smalls) > 0 else None + print(f"Generate {folder} html") html_rendered = template.render(exif=exif, raw=raw, large=large, small=small) with open(os.path.join(path, f"{folder}.html"), "w") as f: @@ -99,5 +104,10 @@ def main(): generate_page(output_path) + general_path: str = os.path.join(output_path, "general") + if not os.path.exists(general_path): + #os.makedirs(general_path) + shutil.copytree("src/templates/", general_path) + if (__name__ == "__main__"): main() \ No newline at end of file diff --git a/src/templates/icons/file.png b/src/templates/icons/file.png new file mode 100644 index 0000000000000000000000000000000000000000..470495a4f5be08fbf58a1572fd2e4ff89a248a7a GIT binary patch literal 13040 zcmeHuXH=8h)^73|gn$Ku5jP?rMDP$Pib#iS6alFU37w!+1x1>4NNj9_Qk5P+QRzjH zju2%>KoC$VBE1Fy>AmHy;NIt+Z;W%l-*=32{6iqC&NbKbJaew;LqmPdy_|fUFc@sF zw$}N}Fc<_rLNJcq;K!m*+dBAx@KDz_<^cZ!IPCs_!GvJi=YKc$vHscXT;Sy$$UFO@ z9Ho8{C5bFo;Z`SM>ScR8*M(52Lw|fHl*>!RUUfzX4q^j;JQ{v9Jbr}e$**Ii^yNUh zQTkIwjF#aZ1mYlvwiAzl`(5>D7+hUla=W@gAw*2fKPBmHi}^;4WD2usMxmuThdH`H zbpF|I?f-85FFe>|M4H#(elfwXwx7ONX!^(kS%`$tDjpVcJqb(WA3;R z+FjWuK|%mCqbyk9oZQE9PA%92g#|H_(qt>QjG;9&1D|C5nhL}Grgb@$Td4Ih?HvBo zXC!T9V)-bVm|a#rl!#vO`ufD2W6wDpB>l+u+cdpsLQSfl5;`&SjDmq_@2(nf#jfet z$Uwo?pL&el8aw)#7Qr=!k#@La(tdCxP5PB|$Rg2lZUODuw;tU06N><22?_2UaiWP~ z^D-XUH1 zx55RbG&g^>sn5x5^Lb1YY#(v%BPF0DpIb=Uk{q4o+>%+AGc-gA!QRZTU)#k=zJ%0* zeb?*E&iWB-Ij4hW5H@uy^PJ*gWHeh8$H+)eQd%?*hii6y9fFhmnFF-dZ6Cb8oI==a zr=*wuxI;j4%ctU0)dL;q3*z%k3v2-YEu3+vt3D1YP?-D~Gv6G%LGSlolbgxcfULNZ zE}=z{S_+pV^SQ+lyQPHS-=+?Z$}sttTa<#OwiAmx`N*nl?wFZY!Y<8;d`zmr4KHtD zA^7+`H{#O~I#W)(&w8+cSzWLEkd}cci6&`gb!v)Z;AsifYhDDXAYMVOC}C}svSK_U zbM8Kje2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