commit 608a0838616d765e00451d17810f9db6a0a886a4
parent 50a45b6a8202214ab7beb551526bf0515fe43eca
Author: vx-clutch <[email protected]>
Date: Sat, 3 Jan 2026 16:51:16 -0500
patch: fix the back option for archives
Diffstat:
2 files changed, 13 insertions(+), 11 deletions(-)
diff --git a/modules/server/server.go b/modules/server/server.go
@@ -286,23 +286,25 @@ func generateArchiveIndex(fsPath string, urlPath string) (string, error) {
urlPath = basePath(strings.TrimPrefix(urlPath, "/archive"))
var b strings.Builder
+
b.WriteString("<html>\n<head><title>Index of ")
b.WriteString(template.HTMLEscapeString(urlPath))
b.WriteString("</title></head>\n<body>\n<h1>Index of ")
b.WriteString(template.HTMLEscapeString(urlPath))
b.WriteString("</h1><hr><pre>")
- if urlPath != "/archive" && urlPath != "/archive/" {
- up := path.Dir(urlPath)
- if up == "." {
- up = "/archive"
- }
- if !strings.HasSuffix(up, "/") {
- up = "/archive" + filepath.Dir(up) + "/"
- }
- b.WriteString(`<a href="` + template.HTMLEscapeString(up) + `">../</a>` + "\n")
+
+ if urlPath != "/" {
+ b.WriteString(
+ `<a href="/archive` +
+ template.HTMLEscapeString(path.Dir(strings.TrimSuffix(urlPath, "/"))) +
+ `">../</a>` + "\n",
+ )
} else {
- b.WriteString(`<a href="../">../</a>` + "\n")
+ b.WriteString(
+ `<a href="/">../</a>` + "\n",
+ )
}
+
nameCol := 50
for _, ei := range list {
escapedName := template.HTMLEscapeString(ei.name)
diff --git a/modules/version/version.go b/modules/version/version.go
@@ -9,7 +9,7 @@ var gitCommit string = "devel"
const PROGRAM_NAME string = "fes"
const PROGRAM_NAME_LONG string = "fes/fSD"
-const VERSION string = "0.2.0"
+const VERSION string = "0.2.1"
func Version() {
fmt.Printf("%s version %s\n", PROGRAM_NAME_LONG, VERSION)