Add .. link.

This commit is contained in:
voussoir 2022-04-07 13:48:38 -07:00
parent 5cd856073c
commit 2e68c0bba7
No known key found for this signature in database
GPG key ID: 5F7554F8C26DACCB

View file

@ -740,6 +740,9 @@ def markdown_flask(core_filename, port, *args, **kwargs):
if path.is_dir:
atags = []
if path in cwd:
parent = path.parent.relative_to(cwd, simple=True)
atags.append(f'<a href="/{parent}">..</a>')
children = sorted(path.listdir(), key=lambda p: (p.is_file, p.basename.lower()))
for child in children:
relative = child.relative_to(cwd, simple=True)