From 786b0c7ce90dacafb21fa2fdd3708440c7983eb5 Mon Sep 17 00:00:00 2001 From: woon Date: Sat, 11 Mar 2023 15:45:59 +0800 Subject: [PATCH] update --- main.go | 2 +- templates/index.html | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/main.go b/main.go index 6753fd9..04c0fcb 100644 --- a/main.go +++ b/main.go @@ -85,7 +85,7 @@ func listDir(dir string) ([]FileInfo, error) { } Href := filepath.Join(dir, name) - //Href = strings.Replace(Href, filepath.Join(rootPath), "", -1) + Href = strings.Replace(Href, filepath.Join(rootPath), "", -1) size := fileInfo.Size() formattedSize := formatFileSize(size) diff --git a/templates/index.html b/templates/index.html index a47b044..49a524b 100644 --- a/templates/index.html +++ b/templates/index.html @@ -12,9 +12,9 @@ {{range .}} {{if .IsDir}} - /{{.Name}} + /{{.Name}} {{else}} - {{.Name}} + {{.Name}} {{end}} {{.Size}}