Skip to content

Commit

Permalink
idk what i did
Browse files Browse the repository at this point in the history
  • Loading branch information
9551-Dev committed Mar 11, 2024
1 parent ebae42b commit e8ae2b1
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 6 deletions.
2 changes: 1 addition & 1 deletion assets/index_template.html
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@
<body>
<h1>{{title}}</h1>
<ul>
{{directory_list}}
{{directory_list}}
</ul>
{{comment_start}}<button onclick="location.href='..';">.. (zap.devvie.cc{{parent}})</button>{{comment_end}}
</body>
Expand Down
9 changes: 4 additions & 5 deletions gallery_generator.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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"<li><a href=\"{item}/\">{item}/ <sub>[DIR]</sub></a></li>\n"
directory_list_content += f" <li><a href=\"{item}/\">{item}/ <sub>[DIR]</sub></a></li>\n"
for item in file_items:
file_list_content += f"<li><a href=\"{item}\">{item} <sub>[FILE]</sub></a></li>\n"
file_list_content += f" <li><a href=\"{item}\">{item} <sub>[FILE]</sub></a></li>\n"

directory_list_content += f"<li><a href=\"{index_name}\">{index_name} <sub>[THIS]</sub></a></li>\n"
directory_list_content += f" <li><a href=\"{index_name}\">{index_name} <sub>[THIS]</sub></a></li>\n"

index_content = index_content.replace('{{directory_list}}',directory_list_content+file_list_content)

Expand Down Expand Up @@ -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]")
Expand Down

0 comments on commit e8ae2b1

Please sign in to comment.