From 4cef23090f249590e0cb546f9a6b27088ef7bfa2 Mon Sep 17 00:00:00 2001 From: Bhargava Sana Date: Tue, 10 Dec 2024 14:45:31 -0800 Subject: [PATCH] Fix bug to directory hrefs within index generation --- generate_index.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/generate_index.py b/generate_index.py index 47c887b..0cbbc80 100644 --- a/generate_index.py +++ b/generate_index.py @@ -46,7 +46,7 @@ def generate_index(dir_path): has_content = True elif os.path.isdir(file_path) and os.path.basename(file_path) != ".github": # Add directories, but avoid creating links for excluded directories like `.github` - dir_url = file_path.replace(base_dir, "").replace(os.sep, "/") + dir_url = os.path.basename(file_path) # Get the directory name directly index_content += f'
  • {file}/
  • ' has_content = True # If no valid files or directories were found, still create the index file with a message