From e8ae2b1dd8929e1b596f7898efbfcd5c2f1bf8a4 Mon Sep 17 00:00:00 2001
From: 9551-Dev <9551dev@gmail.com>
Date: Mon, 11 Mar 2024 20:19:48 +0100
Subject: [PATCH] idk what i did
---
assets/index_template.html | 2 +-
gallery_generator.py | 9 ++++-----
2 files changed, 5 insertions(+), 6 deletions(-)
diff --git a/assets/index_template.html b/assets/index_template.html
index 70b7cb0..6969017 100644
--- a/assets/index_template.html
+++ b/assets/index_template.html
@@ -53,7 +53,7 @@
{{title}}
- {{directory_list}}
+{{directory_list}}
{{comment_start}}{{comment_end}}
diff --git a/gallery_generator.py b/gallery_generator.py
index 7b9585f..6df29ac 100644
--- a/gallery_generator.py
+++ b/gallery_generator.py
@@ -160,7 +160,7 @@ def remove_comment(index_content):
return index_content
-def generate_directory_index(directory_path, index, index_name):
+def generate_directory_index(directory_path,index,index_name):
print(f"Generating index for directory: {directory_path}")
index_content = get_index_content(index)
@@ -187,11 +187,11 @@ def generate_directory_index(directory_path, index, index_name):
file_items.sort()
for item in directory_items:
- directory_list_content += f"{item}/ [DIR]\n"
+ directory_list_content += f" {item}/ [DIR]\n"
for item in file_items:
- file_list_content += f"{item} [FILE]\n"
+ file_list_content += f" {item} [FILE]\n"
- directory_list_content += f"{index_name} [THIS]\n"
+ directory_list_content += f" {index_name} [THIS]\n"
index_content = index_content.replace('{{directory_list}}',directory_list_content+file_list_content)
@@ -236,7 +236,6 @@ def generate_directory_indexes(output_folder,output,index):
generate_directory_index(index["base_directory"] or output["output_folder"].split(os.sep)[0],index,index["root_index_name"] or "index.html")
-
if __name__ == '__main__':
if len(sys.argv) != 2:
print("Usage: python script.py [config_path]")