From 7ac2f24f2b3f28e5040428574e933960e09bbb52 Mon Sep 17 00:00:00 2001 From: Bhargava Sana Date: Mon, 2 Dec 2024 18:10:57 -0800 Subject: [PATCH] Exclude additional folders from the listing --- generate_index.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/generate_index.py b/generate_index.py index 7429b01..1d8278f 100644 --- a/generate_index.py +++ b/generate_index.py @@ -3,10 +3,12 @@ # Define the base directory (e.g., your repository root) base_dir = "./" +exclude_folders = ['.github', '.git'] + # Function to generate index.html for a given folder def generate_index(dir_path): - # Avoid generating index in .github folder - if ".github" in dir_path: + # Avoid generating index in any excluded folders + if any(excluded in dir_path for excluded in exclude_folders): return files = os.listdir(dir_path)