Skip to content

Commit

Permalink
Fix bug to directory hrefs within index generation
Browse files Browse the repository at this point in the history
  • Loading branch information
bhargavasana authored Dec 10, 2024
1 parent f75b790 commit 4cef230
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion generate_index.py
Original file line number Diff line number Diff line change
Expand Up @@ -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'<li><a href="{dir_url}/">{file}/</a></li>'
has_content = True
# If no valid files or directories were found, still create the index file with a message
Expand Down

0 comments on commit 4cef230

Please sign in to comment.