Sort items alphabetically by name, with directories first

This commit is contained in:
2024-08-17 09:39:55 -04:00
parent 46933a6954
commit b1642883ba
+1
View File
@@ -210,6 +210,7 @@ def process_directory(full_path: pathlib.Path) -> Tuple[List[FileInfo], Optional
)
all_items.append(item_data)
# Sort items alphabetically by name, with directories first
all_items.sort(key=lambda x: (not x.is_dir, x.name.lower()))
index_file = full_path / "index.md"