changeset 7:8e4813b4e509

update index style + justfile additions
author Atarwn Gard <a@qwa.su>
date Tue, 10 Mar 2026 12:12:33 +0500
parents 54ab94198677
children 2ffb8028ccbb
files justfile main.go
diffstat 2 files changed, 23 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- a/justfile	Tue Mar 10 10:22:02 2026 +0500
+++ b/justfile	Tue Mar 10 12:12:33 2026 +0500
@@ -1,7 +1,25 @@
+prefix := "/usr/local"
+bindir := prefix + "/bin"
+mandir := prefix + "/share/man"
+
 build: d2o man
 
 d2o:
-    go build .
+    go build -o d2o .
+
 man:
     lowdown -s -tman man/d2o.1.md -o d2o.1
-    lowdown -s -tman man/d2obase.5.md -o d2obase.5
\ No newline at end of file
+    lowdown -s -tman man/d2obase.5.md -o d2obase.5
+
+install: build
+    install -D -m 755 d2o {{bindir}}/d2o
+    install -D -m 644 d2o.1 {{mandir}}/man1/d2o.1
+    install -D -m 644 d2obase.5 {{mandir}}/man5/d2obase.5
+
+uninstall:
+    rm -f {{bindir}}/d2o
+    rm -f {{mandir}}/man1/d2o.1
+    rm -f {{mandir}}/man5/d2obase.5
+
+clean:
+    rm -f d2o d2o.1 d2obase.5
\ No newline at end of file
--- a/main.go	Tue Mar 10 10:22:02 2026 +0500
+++ b/main.go	Tue Mar 10 12:12:33 2026 +0500
@@ -274,8 +274,8 @@
 		return
 	}
 	w.Header().Set("Content-Type", "text/html; charset=utf-8")
-	fmt.Fprintf(w, "<html><head><title>Index of %s</title></head><body>\n", urlPath)
-	fmt.Fprintf(w, "<h2>Index of %s</h2><hr><pre>\n", urlPath)
+	fmt.Fprintf(w, "<html><head><title>Index of %s</title><style>body{font-family:monospace}</style></head><body>\n", urlPath)
+	fmt.Fprintf(w, "<h2>Index of %s</h2><pre>\n", urlPath)
 	if urlPath != "/" {
 		fmt.Fprintf(w, "<a href=\"..\">..</a>\n")
 	}
@@ -286,7 +286,7 @@
 		}
 		fmt.Fprintf(w, "<a href=\"%s\">%s</a>\n", path.Join(urlPath, name), name)
 	}
-	fmt.Fprintf(w, "</pre><hr><i>d2o webserver</i></body></html>")
+	fmt.Fprintf(w, "</pre><i>d2o webserver</i></body></html>")
 }
 
 // --- Reverse proxy ----------------------------------------------------------