Skip to content

Commit

Permalink
Exclude additional folders from the listing
Browse files Browse the repository at this point in the history
  • Loading branch information
bhargavasana authored Dec 3, 2024
1 parent 9b33ca5 commit 7ac2f24
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions generate_index.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 7ac2f24

Please sign in to comment.