In the vmarkdown server, list directories before files.
This commit is contained in:
parent
bbe78bc5af
commit
093611e527
1 changed files with 2 additions and 1 deletions
|
@ -601,7 +601,8 @@ def markdown_flask(core_filename, port, *args, **kwargs):
|
||||||
|
|
||||||
if path.is_dir:
|
if path.is_dir:
|
||||||
atags = []
|
atags = []
|
||||||
for child in path.listdir():
|
children = sorted(path.listdir(), key=lambda p: (p.is_file, p.basename.lower()))
|
||||||
|
for child in children:
|
||||||
relative = child.relative_to(cwd, simple=True)
|
relative = child.relative_to(cwd, simple=True)
|
||||||
print(relative)
|
print(relative)
|
||||||
a = f'<p><a href="/{relative}">{child.basename}</a></p>'
|
a = f'<p><a href="/{relative}">{child.basename}</a></p>'
|
||||||
|
|
Loading…
Reference in a new issue