parent:
492a05b8e658a3f2626210f5e33dc874141545f7
nmyk <nick@nmyk.io>
2026-04-22T17:37:13-04:00
UI improvements add info to titles remove unhelpful links move some stuff around
diff --git a/internal/handlers/templates/blob.tmpl b/internal/handlers/templates/blob.tmpl
index 4fd9f0a57fa0fb84548c724ccbc8a7cc0bdf512a..4bf0cab02c85a3e801a68b754db1d47ab43586be 100644
--- a/internal/handlers/templates/blob.tmpl
+++ b/internal/handlers/templates/blob.tmpl
@@ -1,4 +1,4 @@
-{{define "title"}}{{.Repo}}/{{.Path}}{{end}}
+{{define "title"}}{{.Repo}}/{{.Path}} @ {{.RefLabel}}{{end}}
{{define "content"}}
<h1>{{if eq .Path ""}}{{.Repo}}{{else}}<a href="/{{.Repo}}/tree/{{.RefLabel}}">{{.Repo}}</a> /{{end}}
{{range $i, $c := .Crumbs}}
diff --git a/internal/handlers/templates/commit.tmpl b/internal/handlers/templates/commit.tmpl
index c05d5066ad514bdd1327adae463af2e61e40103e..1d3d2f3a013decced66950118541fa717b713a91 100644
--- a/internal/handlers/templates/commit.tmpl
+++ b/internal/handlers/templates/commit.tmpl
@@ -1,8 +1,8 @@
{{define "title"}}{{.Repo}} @ {{.Hash}}{{end}}
{{define "content"}}
<h1><a href="/{{.Repo}}">{{.Repo}}</a></h1>
-<p><a href="/{{.Repo}}/refs">refs</a></p>
-<h4>commit {{.Hash}} | <a href="/{{.Repo}}/tree/{{.Hash}}">tree</a></h4>
+<h3>commit {{.Hash}}</h3>
+<p><a href="/{{.Repo}}/tree/{{.Hash}}">tree</a></p>
<p>{{ if gt (len .Parents) 0 }}parent{{ if gt (len .Parents) 1 }}s{{end}}:{{end}}
{{ range .Parents }}
<br><a href="/{{$.Repo}}/commit/{{.}}">{{.}}</a>
diff --git a/internal/handlers/templates/commits.tmpl b/internal/handlers/templates/commits.tmpl
index f457d44251e83a26e2f4ed4732d0a09c8df35822..11e62b2bd727fff51994ff8d856daae4ea03310c 100644
--- a/internal/handlers/templates/commits.tmpl
+++ b/internal/handlers/templates/commits.tmpl
@@ -1,9 +1,18 @@
-{{define "title"}}{{.Repo}} @ {{.RefLabel}}{{end}}
+{{define "title" -}}
+{{- if eq .Path "" -}}
+commits - {{.Repo}} @ {{.RefLabel}}
+{{- else -}}
+history for {{.Repo}}/{{.Path}} @ {{.RefLabel}}
+{{- end -}}
+{{- end}}
+
{{define "content"}}
<h1><a href="/{{.Repo}}/tree/{{.RefLabel}}">{{.Repo}}</a></h1>
-{{- if eq .Crumbs nil -}}
-<p>@ {{.RefLabel}}</p>
-{{- else -}}
+{{- if eq .Path "" -}}
+<p>@ {{.RefLabel}} | <a href="/{{.Repo}}/refs">refs</a></p>
+{{- end -}}
+<h2>commits</h2>
+{{- if ne .Crumbs nil -}}
<h3>history for {{range $i, $c := .Crumbs}}
{{if $i}} / {{end}}
{{if eq $i (sub (len $.Crumbs) 1)}}
@@ -13,8 +22,6 @@ <a href="/{{$c.URL}}">{{$c.Name}}</a>
{{end}}
{{end}} @ <a href="/{{.Repo}}/tree/{{.RefLabel}}">{{.RefLabel}}</a></h3>
{{- end -}}
-<p><a href="/{{.Repo}}/refs">refs</a></p>
-<h2>commits</h2>
{{ range .Commits }}
<p><a href="/{{$.Repo}}/commit/{{.Hash}}">{{.Hash}}</a></p>
<p>{{.Author}} | <span title="{{rfc3339 .When}}">{{humanize .When}}</span> </p>
diff --git a/internal/handlers/templates/repo.tmpl b/internal/handlers/templates/repo.tmpl
index 9732dec9073ef19e47926dfb5853658f858baaad..45547e37051666c35a91e0b3f02a4811ae1e510f 100644
--- a/internal/handlers/templates/repo.tmpl
+++ b/internal/handlers/templates/repo.tmpl
@@ -1,4 +1,4 @@
-{{define "title"}}{{.Repo}}/{{.Path}}{{end}}
+{{define "title"}}{{.Repo}} @ {{.Ref}}{{end}}
{{define "content"}}
<h1><a href="/">{{.Hostname}}</a> / {{.Repo}}</h1>
<p>@ {{.Ref}}</p>
diff --git a/internal/handlers/templates/tree.tmpl b/internal/handlers/templates/tree.tmpl
index dee93645569acc037c91dcaae9c175174c9edd2a..44290198415eb116859fc77fe5336369de62db0a 100644
--- a/internal/handlers/templates/tree.tmpl
+++ b/internal/handlers/templates/tree.tmpl
@@ -1,4 +1,11 @@
-{{define "title"}}{{.Repo}}/{{.Path}}{{end}}
+{{define "title" -}}
+{{- if eq .Path "" -}}
+{{.Repo}} @ {{.RefLabel}}
+{{- else -}}
+{{.Repo}}/{{.Path}} @ {{.RefLabel}}
+{{- end -}}
+{{- end}}
+
{{define "content"}}
<h1>{{if ne .Path ""}}<a href="/{{.Repo}}/tree/{{.RefLabel}}">{{.Repo}}</a> /
{{else}}