ugit @main -
refs -
log -
-
https://git.jolheiser.com/ugit.git
fix: base breadcrumb requires ending slash
Signed-off-by: jolheiser <john.olheiser@gmail.com>
Signature
-----BEGIN PGP SIGNATURE-----
iQIzBAABCgAdFiEEgqEQpE3xoo1QwJO/uFOtpdp7v3oFAmaNo2wACgkQuFOtpdp7
v3qspw//cbfvGFFAenxNyPf+1RKsGUhiS+JSf6LYPaAaSuDWLz/mWe1pWZ5qeLF4
C8l9sVrTr7cWzce4VrEq+eEXq/sxnhMB/gNzEGYldMvPPTCePiSWiYUIL//3MLuk
Qlwfq99q9Y7E+DmQHbNSF2Fyor34hAcsLxyXw4klapOODznXIRElURgSkfYzpRAa
7tLOpZBOJBc3ZcVF7D7u4cvpDYwC7xR9PJzCSLw2Xqcp+5s0bkQubUFDsl19bCBn
S1eR2EJ0NwC7g9nMAWWepF91dGrwrCy0TWDxfL9eNdBqicQgfHhqIrWcRLlhQGqk
CwrwACvvc0Pm4zjQrtuvdMuLAp7kRmIqvxJyimILNuMHYhpBspWOA0uB8ykRPSzQ
8DpYfS2s+NRuKSMlIWKsfMQrPDYnpGjXbNIXOw6zkMbntKJtImq3VwAzR8vYJGFJ
phQwFo3Ptc6fRLzB2oDOs3xkUpkRDpaLRwLZesLcnyYPgjeSV3vgATgHaHxhlcIC
KH6oBnHGEQVIoVZYZVSQfeJZWKBGOoR/mW2HjlpZrRRM/8NKtkPA0CaIL4E38Do4
sRR8myOREivRZQJyl1gSqyg2Ftp7wGRbHkurRgCJIekQGqD1suPTMbPVctJddf5j
brIbTnQaHcx1ieGvBZfyv2ATCDbtdjHr21ws+evR8/ZnPhj3+Yc=
=R97g
-----END PGP SIGNATURE-----
diff --git a/internal/html/repo_breadcrumb.templ b/internal/html/repo_breadcrumb.templ
index cf88dc2b68517917fea7e283baf311c516114e8c..5a4482c45379a609e1ea91f54453c55f716bf2f6 100644
--- a/internal/html/repo_breadcrumb.templ
+++ b/internal/html/repo_breadcrumb.templ
@@ -3,6 +3,7 @@
import (
"fmt"
"strings"
+ "path"
)
type RepoBreadcrumbComponentContext struct {
@@ -22,13 +23,13 @@ parts := strings.Split(r.Path, "/")
breadcrumbs := []breadcrumb{
{
label: r.Repo,
- href: fmt.Sprintf("/%s/tree/%s", r.Repo, r.Ref),
+ href: fmt.Sprintf("/%s/tree/%s/", r.Repo, r.Ref),
},
}
for idx, part := range parts {
breadcrumbs = append(breadcrumbs, breadcrumb{
label: part,
- href: breadcrumbs[idx].href + "/" + part,
+ href: path.Join(breadcrumbs[idx].href, part),
})
}
breadcrumbs[len(breadcrumbs)-1].end = true
diff --git a/internal/html/repo_breadcrumb_templ.go b/internal/html/repo_breadcrumb_templ.go
index 85f23791682a3b1a4d4805258db980e87526f423..98fc5568d23f56dc9bb9eaadbac65b1a39456120 100644
--- a/internal/html/repo_breadcrumb_templ.go
+++ b/internal/html/repo_breadcrumb_templ.go
@@ -12,6 +12,7 @@ import "bytes"
import (
"fmt"
+ "path"
"strings"
)
@@ -32,14 +33,14 @@ parts := strings.Split(r.Path, "/")
breadcrumbs := []breadcrumb{
{
label: r.Repo,
-
import "io"
+import "github.com/a-h/templ"
},
}
for idx, part := range parts {
breadcrumbs = append(breadcrumbs, breadcrumb{
label: part,
- href: breadcrumbs[idx].href + "/" + part,
+ href: path.Join(breadcrumbs[idx].href, part),
})
}
breadcrumbs[len(breadcrumbs)-1].end = true
@@ -73,7 +74,7 @@ }
var templ_7745c5c3_Var2 string
templ_7745c5c3_Var2, templ_7745c5c3_Err = templ.JoinStringErrs(crumb.label)
if templ_7745c5c3_Err != nil {
- return templ.Error{Err: templ_7745c5c3_Err, FileName: `repo_breadcrumb.templ`, Line: 43, Col: 24}
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `repo_breadcrumb.templ`, Line: 44, Col: 24}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var2))
if templ_7745c5c3_Err != nil {
@@ -100,7 +101,7 @@ }
var templ_7745c5c3_Var4 string
templ_7745c5c3_Var4, templ_7745c5c3_Err = templ.JoinStringErrs(crumb.label)
if templ_7745c5c3_Err != nil {
- return templ.Error{Err: templ_7745c5c3_Err, FileName: `repo_breadcrumb.templ`, Line: 45, Col: 134}
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `repo_breadcrumb.templ`, Line: 46, Col: 134}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var4))
if templ_7745c5c3_Err != nil {
@@ -113,7 +114,7 @@ }
var templ_7745c5c3_Var5 string
templ_7745c5c3_Var5, templ_7745c5c3_Err = templ.JoinStringErrs(" / ")
if templ_7745c5c3_Err != nil {
- return templ.Error{Err: templ_7745c5c3_Err, FileName: `repo_breadcrumb.templ`, Line: 46, Col: 12}
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `repo_breadcrumb.templ`, Line: 47, Col: 12}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var5))
if templ_7745c5c3_Err != nil {