Fix url in UI

This commit is contained in:
Mukhtar Akere
2025-04-08 21:00:40 +01:00
parent 9011420ac3
commit 92177b150b
3 changed files with 48 additions and 5 deletions

View File

@@ -109,16 +109,16 @@ const directoryTemplate = `
<h1>Index of {{.Path}}</h1>
<ul>
{{if .ShowParent}}
<li><a href="{{.ParentPath}}" class="parent-dir"><span class="file-number"></span>Parent Directory</a></li>
<li><a href="{{urlpath .ParentPath}}" class="parent-dir"><span class="file-number"></span>Parent Directory</a></li>
{{end}}
{{range $index, $file := .Children}}
<li>
<a href="{{$.Path}}/{{$file.Name}}">
<a href="{{urlpath (printf "%s/%s" $.Path $file.Name)}}">
<span class="file-number">{{add $index 1}}.</span>
<span class="file-name">{{$file.Name}}{{if $file.IsDir}}/{{end}}</span>
<span class="file-info">
{{if not $file.IsDir}}
{{$file.Size}} bytes
{{formatSize $file.Size}}
{{end}}
{{$file.ModTime.Format "2006-01-02 15:04:05"}}
</span>