ugit @main -
refs -
log -
-
https://git.jolheiser.com/ugit.git
The code powering this h*ckin' site
feat: breadcrumbs and History.replaceState
- Adds breadcrumbs to repo tree and repo file views
- Fixes line highlighting by replacing state instead of pushing so that going "back" works correctly
Signed-off-by: jolheiser <john.olheiser@gmail.com>
Signature
-----BEGIN PGP SIGNATURE-----
iQIzBAABCgAdFiEEgqEQpE3xoo1QwJO/uFOtpdp7v3oFAmZ86c4ACgkQuFOtpdp7
v3phHQ/+LghAFwABFwjqMh949YJ4WLnQMIj1RUvtP7vgKi/HcqDQCfLrKXsqtcvr
221h0XcQZBB1St+EZfInIgqCOg/NOe/KTWOrd+MPQLBB8H7H7J1rA/hgTszUsEtj
38xuUyNhCDMHw4v4OG9PTZk7KkhtPDhwvh9wVWX8+C2rB+aR9Pra0BbRCsGujXHD
bzzj8ryH0xT99kHc3KAGqrEAXQVm16OiJLhftxEWMpdXwOzMert8qnPMmrSba8le
oWJXxylpVyRrwx/VKAvi7OmX+SzSUZKzuu09VE1kt/lslQxJk44cIUPlLf2HKXVX
Ti7oIyL8LiEFA85qVU3gF7XTpJek80kv0gr91GPZuSsfsMyU5q6BshLpq0/X2pgP
ruAtRw8sYHp00CR8jQ3fRrpkvLvvG9qvQaELRcDhvTWuu9m8rftm2t11GwNpjArC
MK53De5qDvp9xyA+TNSNyV6gL7GDzjj2TRFgARn2ySLdXmjDnhCVFQD8u8QvG9l5
q2lyHtYDHCHJyoSJ7yYZFyZ0QQX+dkVVhM9CW2lXkYIW4vEXJnOKEtFQEiUE/PZ6
PJEboMKcR78g9zkydR4awwjJ7cnf5G23NtTdOT6Ikwaklexi0+UBny0sdBVSI2Kf
C7s07Z8M5zVxzuCgHPGFOshVJQcjIN4FkL9sl+TTT+ts4Snyg68=
=649q
-----END PGP SIGNATURE-----
17 changed files, 520 additions(+), 489 deletions(-)
diff --git a/flake.lock b/flake.lock
index eccc824d5034aa76ec5866d590642faa2328afa9..6e136355501a7bd20ed340e161b8a9c3bb6f2232 100644
--- a/flake.lock
+++ b/flake.lock
@@ -41,11 +41,11 @@ }
},
"nixpkgs": {
"locked": {
- "lastModified": 1704161960,
+ "lastModified": 1719379843,
- "narHash": "sha256-QGua89Pmq+FBAro8NriTuoO/wNaUtugt29/qqA8zeeM=",
+ "narHash": "sha256-u+D+IOAMMl70+CJ9NKB+RMrASjInuIWMHzjLWQjPZ6c=",
"owner": "nixos",
"repo": "nixpkgs",
- "rev": "63143ac2c9186be6d9da6035fa22620018c85932",
+ "rev": "b3f3c1b13fb08f3828442ee86630362e81136bbc",
"type": "github"
},
"original": {
diff --git a/internal/html/base_templ.go b/internal/html/base_templ.go
index b107255de7763dbd8c9f95f4491a2d389c07e5c4..0b87e44d4764b49ce838f55d7aeb9709ff78c75b 100644
--- a/internal/html/base_templ.go
+++ b/internal/html/base_templ.go
@@ -1,6 +1,6 @@
// Code generated by templ - DO NOT EDIT.
-// templ: version: v0.2.501
+// templ: version: v0.2.707
package html
//lint:file-ignore SA4006 This context is only used if a nested component is present.
@@ -35,7 +35,7 @@ }
var templ_7745c5c3_Var2 string
templ_7745c5c3_Var2, templ_7745c5c3_Err = templ.JoinStringErrs(bc.Title)
if templ_7745c5c3_Err != nil {
- return templ.Error{Err: templ_7745c5c3_Err, FileName: `base.templ`, Line: 13, Col: 20}
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `base.templ`, Line: 14, Col: 20}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var2))
if templ_7745c5c3_Err != nil {
@@ -45,32 +45,33 @@ _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("</title><link rel=\"icon\" href=\"/_/favicon.svg\"><link rel=\"stylesheet\" href=\"/_/tailwind.css\"><meta property=\"og:title\" content=\"")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
-// templ: version: v0.2.501
+ var templ_7745c5c3_Var3 string
package html
+import "bytes"
if templ_7745c5c3_Err != nil {
- return templ_7745c5c3_Err
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `base.templ`, Line: 17, Col: 47}
}
-// templ: version: v0.2.501
//lint:file-ignore SA4006 This context is only used if a nested component is present.
+// Code generated by templ - DO NOT EDIT.
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
// templ: version: v0.2.501
-import "github.com/a-h/templ"
+//lint:file-ignore SA4006 This context is only used if a nested component is present.
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
+ var templ_7745c5c3_Var4 string
+//lint:file-ignore SA4006 This context is only used if a nested component is present.
// templ: version: v0.2.501
-import "context"
if templ_7745c5c3_Err != nil {
- return templ_7745c5c3_Err
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `base.templ`, Line: 18, Col: 59}
}
- templ_7745c5c3_Var3 := `Home`
- _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var3)
+ _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var4))
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
- _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("</a></h2>")
+ _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("\"></head><body class=\"latte dark:mocha bg-base/50 dark:bg-base/95 max-w-7xl mx-5 sm:mx-auto my-10\"><h2 class=\"text-text text-xl mb-3\"><a class=\"underline decoration-text/50 decoration-dashed hover:decoration-solid\" href=\"/\">Home</a></h2>")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
diff --git a/internal/html/index_templ.go b/internal/html/index_templ.go
index f3787bee3e52b78193a4eb7dcbe451432a7b8eb4..7d162d1475ce56e951944e202513c645dc3f53eb 100644
--- a/internal/html/index_templ.go
+++ b/internal/html/index_templ.go
@@ -1,6 +1,6 @@
// Code generated by templ - DO NOT EDIT.
-// templ: version: v0.2.501
+// templ: version: v0.2.707
package html
//lint:file-ignore SA4006 This context is only used if a nested component is present.
@@ -68,8 +68,8 @@ }
var templ_7745c5c3_Var3 string
templ_7745c5c3_Var3, templ_7745c5c3_Err = templ.JoinStringErrs(ic.Title)
if templ_7745c5c3_Err != nil {
-//lint:file-ignore SA4006 This context is only used if a nested component is present.
import "github.com/a-h/templ"
+// Code generated by templ - DO NOT EDIT.
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var3))
if templ_7745c5c3_Err != nil {
@@ -82,8 +82,8 @@ }
var templ_7745c5c3_Var4 string
templ_7745c5c3_Var4, templ_7745c5c3_Err = templ.JoinStringErrs(ic.Description)
if templ_7745c5c3_Err != nil {
-import "github.com/a-h/templ"
// Code generated by templ - DO NOT EDIT.
+ if err != nil {
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var4))
if templ_7745c5c3_Err != nil {
@@ -101,8 +101,8 @@ }
var templ_7745c5c3_Var5 string
templ_7745c5c3_Var5, templ_7745c5c3_Err = templ.JoinStringErrs(`@` + ic.Profile.Username)
if templ_7745c5c3_Err != nil {
-import "context"
// Code generated by templ - DO NOT EDIT.
+ return ""
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var5))
if templ_7745c5c3_Err != nil {
@@ -138,7 +138,7 @@ }
var templ_7745c5c3_Var7 string
templ_7745c5c3_Var7, templ_7745c5c3_Err = templ.JoinStringErrs(ic.Profile.Email)
if templ_7745c5c3_Err != nil {
- return templ.Error{Err: templ_7745c5c3_Err, FileName: `index.templ`, Line: 48, Col: 159}
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `index.templ`, Line: 49, Col: 159}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var7))
if templ_7745c5c3_Err != nil {
@@ -178,7 +178,7 @@ }
var templ_7745c5c3_Var9 string
templ_7745c5c3_Var9, templ_7745c5c3_Err = templ.JoinStringErrs(link.Name)
if templ_7745c5c3_Err != nil {
- return templ.Error{Err: templ_7745c5c3_Err, FileName: `index.templ`, Line: 56, Col: 141}
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `index.templ`, Line: 57, Col: 141}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var9))
if templ_7745c5c3_Err != nil {
@@ -211,7 +211,7 @@ var templ_7745c5c3_Var11 string
templ_7745c5c3_Var11, templ_7745c5c3_Err = templ.JoinStringErrs(repo.Name())
if templ_7745c5c3_Err != nil {
// Code generated by templ - DO NOT EDIT.
-package html
+ return humanize.Time(c.When)
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var11))
if templ_7745c5c3_Err != nil {
@@ -225,7 +225,7 @@ var templ_7745c5c3_Var12 string
templ_7745c5c3_Var12, templ_7745c5c3_Err = templ.JoinStringErrs(repo.Meta.Description)
if templ_7745c5c3_Err != nil {
// Code generated by templ - DO NOT EDIT.
-import "bytes"
+ return c.When.Format("01/02/2006 03:04:05 PM")
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var12))
if templ_7745c5c3_Err != nil {
@@ -236,7 +236,12 @@ if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
import "github.com/dustin/go-humanize"
-
+// templ: version: v0.2.501
+ templ_7745c5c3_Var13, templ_7745c5c3_Err = templ.JoinStringErrs(lastCommit(repo, false))
+ if templ_7745c5c3_Err != nil {
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `index.templ`, Line: 65, Col: 89}
+ }
+ _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var13))
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
@@ -245,16 +250,16 @@ if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
// Code generated by templ - DO NOT EDIT.
-// Code generated by templ - DO NOT EDIT.
// templ: version: v0.2.501
+//lint:file-ignore SA4006 This context is only used if a nested component is present.
// Code generated by templ - DO NOT EDIT.
- BaseContext
+ if !templ_7745c5c3_IsBuffer {
if templ_7745c5c3_Err != nil {
// Code generated by templ - DO NOT EDIT.
- Profile IndexProfile
+ templ_7745c5c3_Buffer = templ.GetBuffer()
}
// Code generated by templ - DO NOT EDIT.
- Repos []*git.Repo
+ defer templ.ReleaseBuffer(templ_7745c5c3_Buffer)
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
diff --git a/internal/html/readme_templ.go b/internal/html/readme_templ.go
index cacc91ee6b32880e6bde5775824f8d2ac476d635..c935a0c49fb70da50f471408298d266a24babeb1 100644
--- a/internal/html/readme_templ.go
+++ b/internal/html/readme_templ.go
@@ -1,6 +1,7 @@
// Code generated by templ - DO NOT EDIT.
// templ: version: v0.2.501
+//lint:file-ignore SA4006 This context is only used if a nested component is present.
package html
//lint:file-ignore SA4006 This context is only used if a nested component is present.
diff --git a/internal/html/repo_breadcrumb.templ b/internal/html/repo_breadcrumb.templ
new file mode 100644
index 0000000000000000000000000000000000000000..cf88dc2b68517917fea7e283baf311c516114e8c
--- /dev/null
+++ b/internal/html/repo_breadcrumb.templ
@@ -0,0 +1,51 @@
+package html
+
+import (
+ "fmt"
+ "strings"
+)
+
+type RepoBreadcrumbComponentContext struct {
+ Repo string
+ Ref string
+ Path string
+}
+
+type breadcrumb struct {
+ label string
+ href string
+ end bool
+}
+
+func (r RepoBreadcrumbComponentContext) crumbs() []breadcrumb {
+ parts := strings.Split(r.Path, "/")
+ breadcrumbs := []breadcrumb{
+ {
+ label: r.Repo,
+ 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,
+ })
+ }
+ breadcrumbs[len(breadcrumbs)-1].end = true
+ return breadcrumbs
+}
+
+templ repoBreadcrumbComponent(rbcc RepoBreadcrumbComponentContext) {
+ if rbcc.Path != "" {
+ <div class="inline-block text-text">
+ for _, crumb := range rbcc.crumbs() {
+ if crumb.end {
+ <span>{ crumb.label }</span>
+ } else {
+ <a class="underline decoration-text/50 decoration-dashed hover:decoration-solid" href={ templ.SafeURL(crumb.href) }>{ crumb.label }</a>
+ { " / " }
+ }
+ }
+ </div>
+ }
+}
diff --git a/internal/html/repo_breadcrumb_templ.go b/internal/html/repo_breadcrumb_templ.go
new file mode 100644
index 0000000000000000000000000000000000000000..85f23791682a3b1a4d4805258db980e87526f423
--- /dev/null
+++ b/internal/html/repo_breadcrumb_templ.go
@@ -0,0 +1,133 @@
+// Code generated by templ - DO NOT EDIT.
+
+// templ: version: v0.2.707
+package html
+
+//lint:file-ignore SA4006 This context is only used if a nested component is present.
+
+import "github.com/a-h/templ"
+import "context"
+import "io"
+import "bytes"
+
+import (
+ "fmt"
+ "strings"
+)
+
+type RepoBreadcrumbComponentContext struct {
+ Repo string
+ Ref string
+ Path string
+}
+
+type breadcrumb struct {
+ label string
+ href string
+ end bool
+}
+
+func (r RepoBreadcrumbComponentContext) crumbs() []breadcrumb {
+ parts := strings.Split(r.Path, "/")
+ breadcrumbs := []breadcrumb{
+ {
+ label: r.Repo,
+ 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,
+ })
+ }
+ breadcrumbs[len(breadcrumbs)-1].end = true
+ return breadcrumbs
+}
+
+func repoBreadcrumbComponent(rbcc RepoBreadcrumbComponentContext) templ.Component {
+ return templ.ComponentFunc(func(ctx context.Context, templ_7745c5c3_W io.Writer) (templ_7745c5c3_Err error) {
+ templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templ_7745c5c3_W.(*bytes.Buffer)
+ if !templ_7745c5c3_IsBuffer {
+ templ_7745c5c3_Buffer = templ.GetBuffer()
+ defer templ.ReleaseBuffer(templ_7745c5c3_Buffer)
+ }
+ ctx = templ.InitializeContext(ctx)
+ templ_7745c5c3_Var1 := templ.GetChildren(ctx)
+ if templ_7745c5c3_Var1 == nil {
+ templ_7745c5c3_Var1 = templ.NopComponent
+ }
+ ctx = templ.ClearChildren(ctx)
+ if rbcc.Path != "" {
+ _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("<div class=\"inline-block text-text\">")
+ if templ_7745c5c3_Err != nil {
+ return templ_7745c5c3_Err
+ }
+ for _, crumb := range rbcc.crumbs() {
+ if crumb.end {
+ _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("<span>")
+ if templ_7745c5c3_Err != nil {
+ return templ_7745c5c3_Err
+ }
+ 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}
+ }
+ _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var2))
+ if templ_7745c5c3_Err != nil {
+ return templ_7745c5c3_Err
+ }
+ _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("</span>")
+ if templ_7745c5c3_Err != nil {
+ return templ_7745c5c3_Err
+ }
+ } else {
+ _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("<a class=\"underline decoration-text/50 decoration-dashed hover:decoration-solid\" href=\"")
+ if templ_7745c5c3_Err != nil {
+ return templ_7745c5c3_Err
+ }
+ var templ_7745c5c3_Var3 templ.SafeURL = templ.SafeURL(crumb.href)
+ _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(string(templ_7745c5c3_Var3)))
+ if templ_7745c5c3_Err != nil {
+ return templ_7745c5c3_Err
+ }
+ _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("\">")
+ if templ_7745c5c3_Err != nil {
+ return templ_7745c5c3_Err
+ }
+ 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}
+ }
+ _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var4))
+ if templ_7745c5c3_Err != nil {
+ return templ_7745c5c3_Err
+ }
+ _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("</a> ")
+ if templ_7745c5c3_Err != nil {
+ return templ_7745c5c3_Err
+ }
+ 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}
+ }
+ _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var5))
+ if templ_7745c5c3_Err != nil {
+ return templ_7745c5c3_Err
+ }
+ }
+ }
+ _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("</div>")
+ if templ_7745c5c3_Err != nil {
+ return templ_7745c5c3_Err
+ }
+ }
+ if !templ_7745c5c3_IsBuffer {
+ _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteTo(templ_7745c5c3_W)
+ }
+ return templ_7745c5c3_Err
+ })
+}
diff --git a/internal/html/repo_commit_templ.go b/internal/html/repo_commit_templ.go
index 0f6990b1d5ba689a883adcfd2d9e7791099e651f..96542bdc64b091b14843806948cfdf41f86455ab 100644
--- a/internal/html/repo_commit_templ.go
+++ b/internal/html/repo_commit_templ.go
@@ -1,6 +1,6 @@
// Code generated by templ - DO NOT EDIT.
-// templ: version: v0.2.501
+// templ: version: v0.2.707
package html
//lint:file-ignore SA4006 This context is only used if a nested component is present.
@@ -52,27 +52,18 @@ _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(string(templ_7745c5c3_Var3)))
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
- _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("\">")
+ _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("\">tree</a>")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
- templ_7745c5c3_Var4 := `tree`
+ var templ_7745c5c3_Var4 string
- _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var4)
+ templ_7745c5c3_Var4, templ_7745c5c3_Err = templ.JoinStringErrs(" ")
if templ_7745c5c3_Err != nil {
- return templ_7745c5c3_Err
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `repo_commit.templ`, Line: 16, Col: 229}
}
- _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("</a>")
- if templ_7745c5c3_Err != nil {
- return templ_7745c5c3_Err
- }
-package html
+// Code generated by templ - DO NOT EDIT.
import "github.com/a-h/templ"
- templ_7745c5c3_Var5, templ_7745c5c3_Err = templ.JoinStringErrs(" ")
// templ: version: v0.2.501
-import "context"
- return templ.Error{Err: templ_7745c5c3_Err, FileName: `repo_commit.templ`, Line: 15, Col: 229}
- }
- _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var5))
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
@@ -80,77 +71,58 @@ _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("<a class=\"underline decoration-text/50 decoration-dashed hover:decoration-solid\" href=\"")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
-//lint:file-ignore SA4006 This context is only used if a nested component is present.
// Code generated by templ - DO NOT EDIT.
+ var templ_7745c5c3_Var11 string
+ Commit git.Commit
//lint:file-ignore SA4006 This context is only used if a nested component is present.
-
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
- _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("\">")
+ _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("\">log</a>")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
- templ_7745c5c3_Var7 := `log`
- _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var7)
-// templ: version: v0.2.501
+ Commit git.Commit
import "context"
-// templ: version: v0.2.501
+ Commit git.Commit
import "io"
// templ: version: v0.2.501
-//lint:file-ignore SA4006 This context is only used if a nested component is present.
- _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("</a>")
-// templ: version: v0.2.501
import "context"
- return templ_7745c5c3_Err
- }
- var templ_7745c5c3_Var8 string
-//lint:file-ignore SA4006 This context is only used if a nested component is present.
+// Code generated by templ - DO NOT EDIT.
import "github.com/a-h/templ"
+import "bytes"
// templ: version: v0.2.501
-import "context"
//lint:file-ignore SA4006 This context is only used if a nested component is present.
-import "context"
- }
- _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var8))
-// templ: version: v0.2.501
+// Code generated by templ - DO NOT EDIT.
import "context"
- return templ_7745c5c3_Err
- }
-//lint:file-ignore SA4006 This context is only used if a nested component is present.
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
//lint:file-ignore SA4006 This context is only used if a nested component is present.
-import "bytes"
-import "github.com/a-h/templ"
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
- _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("\">")
-// templ: version: v0.2.501
+// Code generated by templ - DO NOT EDIT.
import "context"
+// Code generated by templ - DO NOT EDIT.
- return templ_7745c5c3_Err
- }
-import "github.com/a-h/templ"
// Code generated by templ - DO NOT EDIT.
-import "github.com/a-h/templ"
+import "context"
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
-import "github.com/a-h/templ"
+}
// templ: version: v0.2.501
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
-import "github.com/a-h/templ"
+ var templ_7745c5c3_Var8 string
+}
package html
- templ_7745c5c3_Var11, templ_7745c5c3_Err = templ.JoinStringErrs(rcc.Commit.Message)
if templ_7745c5c3_Err != nil {
- return templ.Error{Err: templ_7745c5c3_Err, FileName: `repo_commit.templ`, Line: 16, Col: 85}
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `repo_commit.templ`, Line: 17, Col: 85}
}
- _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var11))
+ _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var8))
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
@@ -159,25 +131,20 @@ if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
if rcc.Commit.Signature != "" {
- _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("<details class=\"text-text whitespace-pre\"><summary class=\"cursor-pointer\">")
-import "context"
// Code generated by templ - DO NOT EDIT.
- return templ_7745c5c3_Err
- }
- templ_7745c5c3_Var12 := `Signature`
- _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var12)
- if templ_7745c5c3_Err != nil {
- return templ_7745c5c3_Err
- }
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("</summary><div class=\"p-3 bg-base rounded\"><code>")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
+// Code generated by templ - DO NOT EDIT.
var templ_7745c5c3_Var13 string
+// Code generated by templ - DO NOT EDIT.
templ_7745c5c3_Var13, templ_7745c5c3_Err = templ.JoinStringErrs(rcc.Commit.Signature)
if templ_7745c5c3_Err != nil {
+// Code generated by templ - DO NOT EDIT.
return templ.Error{Err: templ_7745c5c3_Err, FileName: `repo_commit.templ`, Line: 20, Col: 65}
}
+// Code generated by templ - DO NOT EDIT.
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var13))
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
@@ -191,27 +158,33 @@ _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(" <div class=\"text-text mt-3\"><div>")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
+// Code generated by templ - DO NOT EDIT.
import "io"
-// templ: version: v0.2.501
+// Code generated by templ - DO NOT EDIT.
+// Code generated by templ - DO NOT EDIT.
import "io"
-package html
+
if templ_7745c5c3_Err != nil {
+// Code generated by templ - DO NOT EDIT.
import "io"
-//lint:file-ignore SA4006 This context is only used if a nested component is present.
+// templ: version: v0.2.501
}
+// Code generated by templ - DO NOT EDIT.
import "io"
-import "github.com/a-h/templ"
+package html
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
- var templ_7745c5c3_Var15 string
+ var templ_7745c5c3_Var11 string
-import "io"
+// Code generated by templ - DO NOT EDIT.
import "io"
+//lint:file-ignore SA4006 This context is only used if a nested component is present.
if templ_7745c5c3_Err != nil {
+// Code generated by templ - DO NOT EDIT.
import "io"
-import "bytes"
+import "github.com/a-h/templ"
}
- _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var15))
+ _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var11))
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
@@ -219,9 +192,9 @@ _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("<a class=\"underline decoration-text/50 decoration-dashed hover:decoration-solid\" href=\"")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
-import "bytes"
// Code generated by templ - DO NOT EDIT.
+ var templ_7745c5c3_Var15 string
- _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(string(templ_7745c5c3_Var16)))
+ _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(string(templ_7745c5c3_Var12)))
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
@@ -229,16 +202,18 @@ _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("\">")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
+func RepoCommit(rcc RepoCommitContext) templ.Component {
import "bytes"
-// templ: version: v0.2.501
+// Code generated by templ - DO NOT EDIT.
import "bytes"
-package html
if templ_7745c5c3_Err != nil {
+// Code generated by templ - DO NOT EDIT.
import "bytes"
-//lint:file-ignore SA4006 This context is only used if a nested component is present.
+// Code generated by templ - DO NOT EDIT.
}
+// Code generated by templ - DO NOT EDIT.
import "bytes"
-import "github.com/a-h/templ"
+
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
@@ -246,8 +220,15 @@ _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("</a></div><div title=\"")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
+ var templ_7745c5c3_Var14 string
+// Code generated by templ - DO NOT EDIT.
import "bytes"
+// templ: version: v0.2.501
+ if templ_7745c5c3_Err != nil {
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `repo_commit.templ`, Line: 26, Col: 64}
+ }
import "io"
+import "github.com/a-h/templ"
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
@@ -255,14 +236,14 @@ _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("\">")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
- var templ_7745c5c3_Var18 string
+ var templ_7745c5c3_Var15 string
// Code generated by templ - DO NOT EDIT.
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `repo_commit.templ`, Line: 24, Col: 223}
if templ_7745c5c3_Err != nil {
// Code generated by templ - DO NOT EDIT.
-// Code generated by templ - DO NOT EDIT.
+ _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var17))
}
-// Code generated by templ - DO NOT EDIT.
+import "bytes"
-
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
@@ -270,15 +252,14 @@ if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
// Code generated by templ - DO NOT EDIT.
-package html
+ _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("</a></div><div title=\"")
// Code generated by templ - DO NOT EDIT.
-//lint:file-ignore SA4006 This context is only used if a nested component is present.
+ _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(rcc.Commit.When.Format("01/02/2006 03:04:05 PM")))
if templ_7745c5c3_Err != nil {
// Code generated by templ - DO NOT EDIT.
-import "github.com/a-h/templ"
+ var templ_7745c5c3_Var18 string
}
-// Code generated by templ - DO NOT EDIT.
+ templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templ_7745c5c3_W.(*bytes.Buffer)
-import "context"
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
@@ -291,8 +272,15 @@ _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("<div class=\"text-text mt-5\"><span class=\"text-text/80\" title=\"")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
+ templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templ_7745c5c3_W.(*bytes.Buffer)
// Code generated by templ - DO NOT EDIT.
+ templ_7745c5c3_Var17, templ_7745c5c3_Err = templ.JoinStringErrs(file.Action)
+import "context"
// Code generated by templ - DO NOT EDIT.
+
+// templ: version: v0.2.501
+ }
+ _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var17))
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
@@ -300,13 +288,13 @@ _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("\">")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
-import "github.com/dustin/go-humanize"
+//lint:file-ignore SA4006 This context is only used if a nested component is present.
- templ_7745c5c3_Var20, templ_7745c5c3_Err = templ.JoinStringErrs(string(file.Action[0]))
+ templ_7745c5c3_Var18, templ_7745c5c3_Err = templ.JoinStringErrs(string(file.Action[0]))
if templ_7745c5c3_Err != nil {
- return templ.Error{Err: templ_7745c5c3_Err, FileName: `repo_commit.templ`, Line: 30, Col: 77}
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `repo_commit.templ`, Line: 31, Col: 77}
}
- _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var20))
+ _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var18))
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
@@ -314,15 +302,15 @@ _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("</span> ")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
- var templ_7745c5c3_Var21 string
+ var templ_7745c5c3_Var19 string
-// Code generated by templ - DO NOT EDIT.
+
// Code generated by templ - DO NOT EDIT.
-import "io"
if templ_7745c5c3_Err != nil {
+
import "github.com/dustin/go-humanize"
-import "bytes"
}
+
import "go.jolheiser.com/ugit/internal/git"
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
@@ -334,11 +322,12 @@ _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("<a class=\"underline decoration-text/50 decoration-dashed hover:decoration-solid\" href=\"")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
+
// Code generated by templ - DO NOT EDIT.
+// templ: version: v0.2.501
-import "context"
// Code generated by templ - DO NOT EDIT.
- templ_7745c5c3_Var1 = templ.NopComponent
+package html
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
@@ -346,36 +335,45 @@ _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("\">")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
+
// Code generated by templ - DO NOT EDIT.
- templ_7745c5c3_Var2 := templ.ComponentFunc(func(ctx context.Context, templ_7745c5c3_W io.Writer) (templ_7745c5c3_Err error) {
+//lint:file-ignore SA4006 This context is only used if a nested component is present.
+
// Code generated by templ - DO NOT EDIT.
- templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templ_7745c5c3_W.(*bytes.Buffer)
+import "github.com/a-h/templ"
if templ_7745c5c3_Err != nil {
+
// Code generated by templ - DO NOT EDIT.
- if !templ_7745c5c3_IsBuffer {
+import "context"
}
+
// Code generated by templ - DO NOT EDIT.
- templ_7745c5c3_Buffer = templ.GetBuffer()
+import "io"
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
+
// Code generated by templ - DO NOT EDIT.
- defer templ.ReleaseBuffer(templ_7745c5c3_Buffer)
+import "bytes"
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
}
if file.From.Path != "" && file.To.Path != "" {
+ var templ_7745c5c3_Var22 string
+ templ_7745c5c3_Buffer = templ.GetBuffer()
// Code generated by templ - DO NOT EDIT.
- templ_7745c5c3_Err = repoHeaderComponent(rcc.RepoHeaderComponentContext).Render(ctx, templ_7745c5c3_Buffer)
// Code generated by templ - DO NOT EDIT.
+ }
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `repo_commit.templ`, Line: 37, Col: 13}
+ }
+ templ_7745c5c3_Buffer = templ.GetBuffer()
// templ: version: v0.2.501
-import "context"
if templ_7745c5c3_Err != nil {
// Code generated by templ - DO NOT EDIT.
- return templ_7745c5c3_Err
+ ctx = templ.InitializeContext(ctx)
}
- _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var24))
+ _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(" ")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
@@ -385,9 +383,9 @@ _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("<a class=\"underline decoration-text/50 decoration-dashed hover:decoration-solid\" href=\"")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
- var templ_7745c5c3_Var25 templ.SafeURL = templ.SafeURL(fmt.Sprintf("/%s/tree/%s/%s", rcc.RepoHeaderComponentContext.Name, file.To.Commit, file.To.Path))
+ var templ_7745c5c3_Var23 templ.SafeURL = templ.SafeURL(fmt.Sprintf("/%s/tree/%s/%s", rcc.RepoHeaderComponentContext.Name, file.To.Commit, file.To.Path))
- BaseContext
+ templ_7745c5c3_Var1 := templ.GetChildren(ctx)
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
@@ -396,14 +394,14 @@ if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
// Code generated by templ - DO NOT EDIT.
-package html
// templ: version: v0.2.501
+import "github.com/a-h/templ"
- templ_7745c5c3_Var26, templ_7745c5c3_Err = templ.JoinStringErrs(file.To.Path)
+ templ_7745c5c3_Var24, templ_7745c5c3_Err = templ.JoinStringErrs(file.To.Path)
if templ_7745c5c3_Err != nil {
- return templ.Error{Err: templ_7745c5c3_Err, FileName: `repo_commit.templ`, Line: 39, Col: 221}
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `repo_commit.templ`, Line: 40, Col: 221}
}
// Code generated by templ - DO NOT EDIT.
- var templ_7745c5c3_Var5 string
+ _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(" <div class=\"text-text mt-5\"><a class=\"underline decoration-text/50 decoration-dashed hover:decoration-solid\" href=\"")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
diff --git a/internal/html/repo_file.templ b/internal/html/repo_file.templ
index e4381fb9bf72f85ca22551ba96fd26162f2543a0..e31026280cd03dd8e5c864f63de3c00ec997885a 100644
--- a/internal/html/repo_file.templ
+++ b/internal/html/repo_file.templ
@@ -1,21 +1,24 @@
package html
type RepoFileContext struct {
- BaseContext
+ BaseContext
RepoHeaderComponentContext
Code string
- Path string
+ Code string
}
templ RepoFile(rfc RepoFileContext) {
@base(rfc.BaseContext) {
@repoHeaderComponent(rfc.RepoHeaderComponentContext)
<div class="mt-2 text-text">
-package html
+ @repoBreadcrumbComponent(rfc.RepoBreadcrumbComponentContext)
+ Code string
type RepoFileContext struct {
<a class="text-text underline decoration-text/50 decoration-dashed hover:decoration-solid" href="?raw">raw</a>
-package html
+ <div class="code">
+ Code string
RepoHeaderComponentContext
+ </div>
</div>
}
<script>
@@ -49,8 +51,8 @@ start = n;
end = 0;
anchor = `#L${start}`;
}
- BaseContext
Code string
+ Path string
activateLines(start, end);
});
}
@@ -72,4 +74,3 @@
</script>
}
-
diff --git a/internal/html/repo_file_templ.go b/internal/html/repo_file_templ.go
index 88dbeae0330d101bf8f595c9c87a8ea5d9b6e44e..4961bacf5b64ddfdf7bbdb6bc1573620dafacffb 100644
--- a/internal/html/repo_file_templ.go
+++ b/internal/html/repo_file_templ.go
@@ -1,6 +1,6 @@
// Code generated by templ - DO NOT EDIT.
-// templ: version: v0.2.501
+// templ: version: v0.2.707
package html
//lint:file-ignore SA4006 This context is only used if a nested component is present.
@@ -14,9 +13,9 @@ type RepoFileContext struct {
BaseContext
RepoHeaderComponentContext
// Code generated by templ - DO NOT EDIT.
// templ: version: v0.2.501
// Code generated by templ - DO NOT EDIT.
-package html
+// templ: version: v0.2.501
}
func RepoFile(rfc RepoFileContext) templ.Component {
@@ -42,45 +41,30 @@ templ_7745c5c3_Err = repoHeaderComponent(rfc.RepoHeaderComponentContext).Render(ctx, templ_7745c5c3_Buffer)
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
- _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(" <div class=\"mt-2 text-text\"><span>")
- if templ_7745c5c3_Err != nil {
- return templ_7745c5c3_Err
- }
- var templ_7745c5c3_Var3 string
- templ_7745c5c3_Var3, templ_7745c5c3_Err = templ.JoinStringErrs(rfc.Path)
- if templ_7745c5c3_Err != nil {
-package html
+// Code generated by templ - DO NOT EDIT.
- }
package html
-// Code generated by templ - DO NOT EDIT.
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
- var templ_7745c5c3_Var4 string
- templ_7745c5c3_Var4, templ_7745c5c3_Err = templ.JoinStringErrs(" - ")
+ templ_7745c5c3_Err = repoBreadcrumbComponent(rfc.RepoBreadcrumbComponentContext).Render(ctx, templ_7745c5c3_Buffer)
if templ_7745c5c3_Err != nil {
- return templ.Error{Err: templ_7745c5c3_Err, FileName: `repo_file.templ`, Line: 13, Col: 28}
// templ: version: v0.2.501
-// templ: version: v0.2.501
- _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var4))
+import "github.com/a-h/templ"
// templ: version: v0.2.501
-//lint:file-ignore SA4006 This context is only used if a nested component is present.
// templ: version: v0.2.501
-import "github.com/a-h/templ"
// templ: version: v0.2.501
-// templ: version: v0.2.501
+import "io"
-package html
+type RepoFileContext struct {
import "github.com/a-h/templ"
if templ_7745c5c3_Err != nil {
- return templ_7745c5c3_Err
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `repo_file.templ`, Line: 15, Col: 10}
}
package html
-import "context"
- _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var5)
+// Code generated by templ - DO NOT EDIT.
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
- _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("</a><div class=\"code\">")
+ _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(" <a class=\"text-text underline decoration-text/50 decoration-dashed hover:decoration-solid\" href=\"?raw\">raw</a><div class=\"code\">")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
@@ -101,69 +85,8 @@ templ_7745c5c3_Err = base(rfc.BaseContext).Render(templ.WithChildren(ctx, templ_7745c5c3_Var2), templ_7745c5c3_Buffer)
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
- _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("<script>")
- if templ_7745c5c3_Err != nil {
- return templ_7745c5c3_Err
- }
- templ_7745c5c3_Var6 := `
- const lineRe = /#L(\d+)(?:-L(\d+))?/g
- const $lineLines = document.querySelectorAll(".chroma .lntable .lnt");
-import "github.com/a-h/templ"
// Code generated by templ - DO NOT EDIT.
- let start = 0;
- let end = 0;
-
- const results = [...location.hash.matchAll(lineRe)];
- if (0 in results) {
- start = results[0][1] !== undefined ? parseInt(results[0][1]) : 0;
- end = results[0][2] !== undefined ? parseInt(results[0][2]) : 0;
- }
- if (start != 0) {
- deactivateLines();
-import "context"
- }
-
- for (let line of $lineLines) {
- line.addEventListener("click", (event) => {
- event.preventDefault();
- deactivateLines();
- const n = parseInt(line.id.substring(1));
- let anchor = "";
- if (event.shiftKey) {
- end = n;
-import "context"
import "bytes"
- } else {
- start = n;
- end = 0;
- anchor = ` + "`" + `#L${start}` + "`" + `;
- }
- history.pushState(null, null, anchor);
- activateLines(start, end);
- });
- }
-
- function activateLines(start, end) {
- if (end < start) end = start;
- for (let idx = start - 1; idx < end; idx++) {
- $codeLines[idx].classList.add("active");
- }
- }
-
- function deactivateLines() {
- for (let code of $codeLines) {
- code.classList.remove("active");
- }
- }
-
-
-
- `
- _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var6)
- if templ_7745c5c3_Err != nil {
- return templ_7745c5c3_Err
- }
- _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("</script>")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
diff --git a/internal/html/repo_log_templ.go b/internal/html/repo_log_templ.go
index 10536ea61e6fa0c7f9f0a3ebb8fa92059d9597a0..849921182d97d92a86e61d4977af41a2faa6c31b 100644
--- a/internal/html/repo_log_templ.go
+++ b/internal/html/repo_log_templ.go
@@ -1,6 +1,6 @@
// Code generated by templ - DO NOT EDIT.
-// templ: version: v0.2.501
+// templ: version: v0.2.707
package html
//lint:file-ignore SA4006 This context is only used if a nested component is present.
@@ -64,7 +64,8 @@ }
var templ_7745c5c3_Var4 string
templ_7745c5c3_Var4, templ_7745c5c3_Err = templ.JoinStringErrs(commit.Short())
if templ_7745c5c3_Err != nil {
-//lint:file-ignore SA4006 This context is only used if a nested component is present.
+// Code generated by templ - DO NOT EDIT.
+import "github.com/a-h/templ"
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var4))
if templ_7745c5c3_Err != nil {
@@ -82,7 +83,8 @@ }
var templ_7745c5c3_Var5 string
templ_7745c5c3_Var5, templ_7745c5c3_Err = templ.JoinStringErrs(commit.Summary())
if templ_7745c5c3_Err != nil {
-import "github.com/a-h/templ"
+// Code generated by templ - DO NOT EDIT.
+import "context"
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var5))
if templ_7745c5c3_Err != nil {
@@ -95,7 +97,7 @@ }
var templ_7745c5c3_Var6 string
templ_7745c5c3_Var6, templ_7745c5c3_Err = templ.JoinStringErrs(commit.Details())
if templ_7745c5c3_Err != nil {
- return templ.Error{Err: templ_7745c5c3_Err, FileName: `repo_log.templ`, Line: 23, Col: 59}
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `repo_log.templ`, Line: 24, Col: 59}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var6))
if templ_7745c5c3_Err != nil {
@@ -109,8 +111,8 @@ } else {
var templ_7745c5c3_Var7 string
templ_7745c5c3_Var7, templ_7745c5c3_Err = templ.JoinStringErrs(commit.Message)
if templ_7745c5c3_Err != nil {
-import "context"
// Code generated by templ - DO NOT EDIT.
+import "bytes"
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var7))
if templ_7745c5c3_Err != nil {
@@ -124,7 +126,7 @@ }
var templ_7745c5c3_Var8 string
templ_7745c5c3_Var8, templ_7745c5c3_Err = templ.JoinStringErrs(commit.Author)
if templ_7745c5c3_Err != nil {
- return templ.Error{Err: templ_7745c5c3_Err, FileName: `repo_log.templ`, Line: 31, Col: 25}
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `repo_log.templ`, Line: 32, Col: 25}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var8))
if templ_7745c5c3_Err != nil {
@@ -133,7 +135,7 @@ }
var templ_7745c5c3_Var9 string
templ_7745c5c3_Var9, templ_7745c5c3_Err = templ.JoinStringErrs(" ")
if templ_7745c5c3_Err != nil {
- return templ.Error{Err: templ_7745c5c3_Err, FileName: `repo_log.templ`, Line: 31, Col: 32}
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `repo_log.templ`, Line: 32, Col: 32}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var9))
if templ_7745c5c3_Err != nil {
@@ -155,7 +157,7 @@ }
var templ_7745c5c3_Var11 string
templ_7745c5c3_Var11, templ_7745c5c3_Err = templ.JoinStringErrs(fmt.Sprintf("<%s>", commit.Email))
if templ_7745c5c3_Err != nil {
- return templ.Error{Err: templ_7745c5c3_Err, FileName: `repo_log.templ`, Line: 31, Col: 213}
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `repo_log.templ`, Line: 32, Col: 213}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var11))
if templ_7745c5c3_Err != nil {
@@ -165,6 +168,12 @@ if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
import "bytes"
+// Code generated by templ - DO NOT EDIT.
+ templ_7745c5c3_Var12, templ_7745c5c3_Err = templ.JoinStringErrs(commit.When.Format("01/02/2006 03:04:05 PM"))
+ if templ_7745c5c3_Err != nil {
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `repo_log.templ`, Line: 33, Col: 62}
+ }
+ _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var12))
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
@@ -172,13 +181,14 @@ _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("\">")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
-import "bytes"
+// Code generated by templ - DO NOT EDIT.
// Code generated by templ - DO NOT EDIT.
+//lint:file-ignore SA4006 This context is only used if a nested component is present.
- templ_7745c5c3_Var12, templ_7745c5c3_Err = templ.JoinStringErrs(humanize.Time(commit.When))
+ templ_7745c5c3_Var13, templ_7745c5c3_Err = templ.JoinStringErrs(humanize.Time(commit.When))
if templ_7745c5c3_Err != nil {
- return templ.Error{Err: templ_7745c5c3_Err, FileName: `repo_log.templ`, Line: 32, Col: 93}
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `repo_log.templ`, Line: 33, Col: 93}
}
- _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var12))
+ _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var13))
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
diff --git a/internal/html/repo_refs_templ.go b/internal/html/repo_refs_templ.go
index dbaaa19e99e3db7a6f1e5e0822a2cea8687af41b..0ec6fc747bb6a2cee5a74267d9785023aa03ce42 100644
--- a/internal/html/repo_refs_templ.go
+++ b/internal/html/repo_refs_templ.go
@@ -1,6 +1,6 @@
// Code generated by templ - DO NOT EDIT.
-// templ: version: v0.2.501
+// templ: version: v0.2.707
package html
//lint:file-ignore SA4006 This context is only used if a nested component is present.
@@ -48,18 +48,9 @@ if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
if len(rrc.Branches) > 0 {
-package html
// Code generated by templ - DO NOT EDIT.
- if templ_7745c5c3_Err != nil {
- return templ_7745c5c3_Err
- }
- templ_7745c5c3_Var3 := `Branches`
- _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var3)
-package html
- return templ_7745c5c3_Err
- }
- _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("</h3><div class=\"text-text grid grid-cols-4 sm:grid-cols-8\">")
+import "io"
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
@@ -68,12 +59,12 @@ _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("<div class=\"col-span-2 sm:col-span-1 font-bold\">")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
- var templ_7745c5c3_Var4 string
+ var templ_7745c5c3_Var3 string
- templ_7745c5c3_Var4, templ_7745c5c3_Err = templ.JoinStringErrs(branch)
+ templ_7745c5c3_Var3, templ_7745c5c3_Err = templ.JoinStringErrs(branch)
if templ_7745c5c3_Err != nil {
- return templ.Error{Err: templ_7745c5c3_Err, FileName: `repo_refs.templ`, Line: 19, Col: 61}
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `repo_refs.templ`, Line: 20, Col: 61}
}
- _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var4))
+ _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var3))
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
@@ -81,35 +72,26 @@ _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("</div><div class=\"col-span-2 sm:col-span-7\"><a class=\"underline decoration-text/50 decoration-dashed hover:decoration-solid\" href=\"")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
- var templ_7745c5c3_Var5 templ.SafeURL = templ.SafeURL(fmt.Sprintf("/%s/tree/%s/", rrc.RepoHeaderComponentContext.Name, branch))
+ var templ_7745c5c3_Var4 templ.SafeURL = templ.SafeURL(fmt.Sprintf("/%s/tree/%s/", rrc.RepoHeaderComponentContext.Name, branch))
- _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(string(templ_7745c5c3_Var5)))
+ _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(string(templ_7745c5c3_Var4)))
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
- _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("\">")
+ _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("\">tree</a>")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
-import "github.com/a-h/templ"
// Code generated by templ - DO NOT EDIT.
+// templ: version: v0.2.501
import "github.com/a-h/templ"
-
- if templ_7745c5c3_Err != nil {
-//lint:file-ignore SA4006 This context is only used if a nested component is present.
// Code generated by templ - DO NOT EDIT.
- }
-import "github.com/a-h/templ"
// templ: version: v0.2.501
+import "context"
if templ_7745c5c3_Err != nil {
-//lint:file-ignore SA4006 This context is only used if a nested component is present.
// Code generated by templ - DO NOT EDIT.
- }
- var templ_7745c5c3_Var7 string
- templ_7745c5c3_Var7, templ_7745c5c3_Err = templ.JoinStringErrs(" ")
- if templ_7745c5c3_Err != nil {
- return templ.Error{Err: templ_7745c5c3_Err, FileName: `repo_refs.templ`, Line: 20, Col: 234}
+ return templ_7745c5c3_Err
}
- _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var7))
+ _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var5))
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
@@ -116,25 +99,15 @@ _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("<a class=\"underline decoration-text/50 decoration-dashed hover:decoration-solid\" href=\"")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
- var templ_7745c5c3_Var8 templ.SafeURL = templ.SafeURL(fmt.Sprintf("/%s/log/%s", rrc.RepoHeaderComponentContext.Name, branch))
- _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(string(templ_7745c5c3_Var8)))
-//lint:file-ignore SA4006 This context is only used if a nested component is present.
+ RepoHeaderComponentContext
-//lint:file-ignore SA4006 This context is only used if a nested component is present.
+ RepoHeaderComponentContext
// Code generated by templ - DO NOT EDIT.
//lint:file-ignore SA4006 This context is only used if a nested component is present.
-
- _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("\">")
-//lint:file-ignore SA4006 This context is only used if a nested component is present.
return templ_7745c5c3_Err
}
-import "context"
// Code generated by templ - DO NOT EDIT.
- _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var9)
- if templ_7745c5c3_Err != nil {
- return templ_7745c5c3_Err
-//lint:file-ignore SA4006 This context is only used if a nested component is present.
+package html
- _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("</a></div>")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
@@ -149,19 +122,9 @@ if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
if len(rrc.Tags) > 0 {
-package html
// Code generated by templ - DO NOT EDIT.
- if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
package html
-package html
- templ_7745c5c3_Var10 := `Tags`
- _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var10)
- if templ_7745c5c3_Err != nil {
- return templ_7745c5c3_Err
- }
- _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("</h3><div class=\"text-text grid grid-cols-8\">")
-package html
return templ_7745c5c3_Err
}
@@ -170,12 +133,12 @@ _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("<div class=\"col-span-1 font-bold\">")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
- var templ_7745c5c3_Var11 string
+ var templ_7745c5c3_Var7 string
- templ_7745c5c3_Var11, templ_7745c5c3_Err = templ.JoinStringErrs(tag.Name)
+ templ_7745c5c3_Var7, templ_7745c5c3_Err = templ.JoinStringErrs(tag.Name)
if templ_7745c5c3_Err != nil {
- return templ.Error{Err: templ_7745c5c3_Err, FileName: `repo_refs.templ`, Line: 28, Col: 49}
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `repo_refs.templ`, Line: 29, Col: 49}
}
- _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var11))
+ _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var7))
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
@@ -183,36 +146,26 @@ _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("</div><div class=\"col-span-7\"><a class=\"underline decoration-text/50 decoration-dashed hover:decoration-solid\" href=\"")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
-import "io"
+ RepoHeaderComponentContext
import "github.com/a-h/templ"
-import "io"
import "context"
- if templ_7745c5c3_Err != nil {
- return templ_7745c5c3_Err
- }
-import "github.com/a-h/templ"
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
- templ_7745c5c3_Var13 := `tree`
- _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var13)
- if templ_7745c5c3_Err != nil {
-//lint:file-ignore SA4006 This context is only used if a nested component is present.
// Code generated by templ - DO NOT EDIT.
- }
-import "github.com/a-h/templ"
// templ: version: v0.2.501
+//lint:file-ignore SA4006 This context is only used if a nested component is present.
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
- var templ_7745c5c3_Var14 string
+ var templ_7745c5c3_Var9 string
-import "bytes"
// Code generated by templ - DO NOT EDIT.
+ for _, branch := range rrc.Branches {
if templ_7745c5c3_Err != nil {
+ RepoHeaderComponentContext
import "bytes"
-
}
- _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var14))
+ _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var9))
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
@@ -220,56 +173,40 @@ _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("<a class=\"underline decoration-text/50 decoration-dashed hover:decoration-solid\" href=\"")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
- var templ_7745c5c3_Var15 templ.SafeURL = templ.SafeURL(fmt.Sprintf("/%s/log/%s", rrc.RepoHeaderComponentContext.Name, tag.Name))
- _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(string(templ_7745c5c3_Var15)))
+// Code generated by templ - DO NOT EDIT.
//lint:file-ignore SA4006 This context is only used if a nested component is present.
+// Code generated by templ - DO NOT EDIT.
-//lint:file-ignore SA4006 This context is only used if a nested component is present.
// Code generated by templ - DO NOT EDIT.
}
- _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("\">")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
- templ_7745c5c3_Var16 := `log`
- _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var16)
- if templ_7745c5c3_Err != nil {
-//lint:file-ignore SA4006 This context is only used if a nested component is present.
// Code generated by templ - DO NOT EDIT.
-//lint:file-ignore SA4006 This context is only used if a nested component is present.
+package html
- _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("</a></div>")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
if tag.Signature != "" {
- _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("<details class=\"col-span-8 whitespace-pre\"><summary class=\"cursor-pointer\">")
// Code generated by templ - DO NOT EDIT.
- return templ_7745c5c3_Err
- }
-import "fmt"
+//lint:file-ignore SA4006 This context is only used if a nested component is present.
// templ: version: v0.2.501
import "fmt"
-package html
-import "fmt"
return templ_7745c5c3_Err
}
// Code generated by templ - DO NOT EDIT.
//lint:file-ignore SA4006 This context is only used if a nested component is present.
+package html
// Code generated by templ - DO NOT EDIT.
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `repo_refs.templ`, Line: 19, Col: 61}
import "fmt"
-// Code generated by templ - DO NOT EDIT.
-// Code generated by templ - DO NOT EDIT.
-
// Code generated by templ - DO NOT EDIT.
+//lint:file-ignore SA4006 This context is only used if a nested component is present.
import "github.com/a-h/templ"
import "fmt"
-import "context"
- if templ_7745c5c3_Err != nil {
- return templ.Error{Err: templ_7745c5c3_Err, FileName: `repo_refs.templ`, Line: 31, Col: 121}
-import "fmt"
// Code generated by templ - DO NOT EDIT.
-import "bytes"
+ _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("</div><div class=\"col-span-2 sm:col-span-7\"><a class=\"underline decoration-text/50 decoration-dashed hover:decoration-solid\" href=\"")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
@@ -283,17 +225,16 @@ if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
// Code generated by templ - DO NOT EDIT.
- RepoHeaderComponentContext
+ var templ_7745c5c3_Var5 templ.SafeURL = templ.SafeURL(fmt.Sprintf("/%s/tree/%s/", rrc.RepoHeaderComponentContext.Name, branch))
-// Code generated by templ - DO NOT EDIT.
Branches []string
+import "bytes"
if templ_7745c5c3_Err != nil {
// Code generated by templ - DO NOT EDIT.
-// Code generated by templ - DO NOT EDIT.
import "github.com/a-h/templ"
}
// Code generated by templ - DO NOT EDIT.
+import "github.com/a-h/templ"
// Code generated by templ - DO NOT EDIT.
-import "context"
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
diff --git a/internal/html/repo_search_templ.go b/internal/html/repo_search_templ.go
index 3e5ccf2d643ae81c51cdd8b4dea85a81629d032f..159e001eafb423bfd3e5965bb942f5e7457a1617 100644
--- a/internal/html/repo_search_templ.go
+++ b/internal/html/repo_search_templ.go
@@ -1,6 +1,6 @@
// Code generated by templ - DO NOT EDIT.
-// templ: version: v0.2.501
+// templ: version: v0.2.707
package html
//lint:file-ignore SA4006 This context is only used if a nested component is present.
@@ -64,11 +64,6 @@ if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
//lint:file-ignore SA4006 This context is only used if a nested component is present.
-package html
- if templ_7745c5c3_Err != nil {
- return templ_7745c5c3_Err
- }
-//lint:file-ignore SA4006 This context is only used if a nested component is present.
//lint:file-ignore SA4006 This context is only used if a nested component is present.
templ_7745c5c3_Err = repoSearchResult(sc.RepoHeaderComponentContext.Name, sc.RepoHeaderComponentContext.Ref, results).Render(ctx, templ_7745c5c3_Buffer)
if templ_7745c5c3_Err != nil {
@@ -80,20 +75,10 @@ if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
if len(sc.DedupeResults()) == 0 {
-import "github.com/a-h/templ"
// Code generated by templ - DO NOT EDIT.
- if templ_7745c5c3_Err != nil {
-//lint:file-ignore SA4006 This context is only used if a nested component is present.
+// Code generated by templ - DO NOT EDIT.
import "io"
//lint:file-ignore SA4006 This context is only used if a nested component is present.
-import "bytes"
- templ_7745c5c3_Var3 := `No results`
- _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var3)
- if templ_7745c5c3_Err != nil {
- return templ_7745c5c3_Err
- }
- _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("</p>")
-//lint:file-ignore SA4006 This context is only used if a nested component is present.
import "context"
return templ_7745c5c3_Err
}
@@ -107,21 +92,9 @@ templ_7745c5c3_Err = base(sc.BaseContext).Render(templ.WithChildren(ctx, templ_7745c5c3_Var2), templ_7745c5c3_Buffer)
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
- _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("<script>")
- if templ_7745c5c3_Err != nil {
- return templ_7745c5c3_Err
- }
-import "context"
// Code generated by templ - DO NOT EDIT.
- const search = new URLSearchParams(window.location.search).get("q");
- if (search !== "") document.querySelector("#search").value = search;
- `
- _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var4)
-import "github.com/a-h/templ"
+// Code generated by templ - DO NOT EDIT.
import "bytes"
- return templ_7745c5c3_Err
- }
- _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("</script>")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
@@ -140,19 +113,20 @@ templ_7745c5c3_Buffer = templ.GetBuffer()
defer templ.ReleaseBuffer(templ_7745c5c3_Buffer)
}
ctx = templ.InitializeContext(ctx)
-import "io"
// Code generated by templ - DO NOT EDIT.
+ currentFile string
-import "io"
+// Code generated by templ - DO NOT EDIT.
+// Code generated by templ - DO NOT EDIT.
- templ_7745c5c3_Var5 = templ.NopComponent
+ templ_7745c5c3_Var3 = templ.NopComponent
}
ctx = templ.ClearChildren(ctx)
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("<div class=\"text-text mt-5\"><a class=\"underline decoration-text/50 decoration-dashed hover:decoration-solid\" href=\"")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
- var templ_7745c5c3_Var6 templ.SafeURL = templ.SafeURL(fmt.Sprintf("/%s/tree/%s/%s#L%d", repo, ref, results[0].File, results[0].Line))
+ var templ_7745c5c3_Var4 templ.SafeURL = templ.SafeURL(fmt.Sprintf("/%s/tree/%s/%s#L%d", repo, ref, results[0].File, results[0].Line))
- _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(string(templ_7745c5c3_Var6)))
+ _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(string(templ_7745c5c3_Var4)))
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
@@ -160,13 +134,13 @@ _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("\">")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
- var templ_7745c5c3_Var7 string
+ var templ_7745c5c3_Var5 string
- templ_7745c5c3_Var7, templ_7745c5c3_Err = templ.JoinStringErrs(results[0].File)
+ templ_7745c5c3_Var5, templ_7745c5c3_Err = templ.JoinStringErrs(results[0].File)
if templ_7745c5c3_Err != nil {
- return templ.Error{Err: templ_7745c5c3_Err, FileName: `repo_search.templ`, Line: 49, Col: 230}
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `repo_search.templ`, Line: 50, Col: 230}
}
-import "bytes"
// Code generated by templ - DO NOT EDIT.
+ if currentFile != "" {
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
@@ -187,26 +161,24 @@ _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("<details class=\"text-text cursor-pointer\"><summary>")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
- var templ_7745c5c3_Var8 string
- templ_7745c5c3_Var8, templ_7745c5c3_Err = templ.JoinStringErrs(fmt.Sprintf("%d ", len(results[1:])))
-//lint:file-ignore SA4006 This context is only used if a nested component is present.
+// Code generated by templ - DO NOT EDIT.
-import "bytes"
import "bytes"
- }
// Code generated by templ - DO NOT EDIT.
+// templ: version: v0.2.501
if templ_7745c5c3_Err != nil {
-//lint:file-ignore SA4006 This context is only used if a nested component is present.
+// Code generated by templ - DO NOT EDIT.
// templ: version: v0.2.501
+// Code generated by templ - DO NOT EDIT.
}
// Code generated by templ - DO NOT EDIT.
-// Code generated by templ - DO NOT EDIT.
-import "fmt"
+// templ: version: v0.2.501
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
// Code generated by templ - DO NOT EDIT.
+// templ: version: v0.2.501
// templ: version: v0.2.501
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
@@ -215,9 +189,9 @@ if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
// Code generated by templ - DO NOT EDIT.
-import "github.com/a-h/templ"
+func RepoSearch(sc SearchContext) templ.Component {
// Code generated by templ - DO NOT EDIT.
-import "context"
+ return templ.ComponentFunc(func(ctx context.Context, templ_7745c5c3_W io.Writer) (templ_7745c5c3_Err error) {
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
@@ -226,15 +200,15 @@ if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
// Code generated by templ - DO NOT EDIT.
-import "bytes"
+ templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templ_7745c5c3_W.(*bytes.Buffer)
// Code generated by templ - DO NOT EDIT.
-import "fmt"
+ if !templ_7745c5c3_IsBuffer {
if templ_7745c5c3_Err != nil {
// Code generated by templ - DO NOT EDIT.
-import "go.jolheiser.com/ugit/internal/git"
+ templ_7745c5c3_Buffer = templ.GetBuffer()
}
// Code generated by templ - DO NOT EDIT.
-type SearchContext struct {
+ defer templ.ReleaseBuffer(templ_7745c5c3_Buffer)
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
diff --git a/internal/html/repo_templ.go b/internal/html/repo_templ.go
index 97dd65e510e75fde93a98935b7f6b98c1e24a1f9..13f562777ce038020dcdd57427c7dc77a5fa71a7 100644
--- a/internal/html/repo_templ.go
+++ b/internal/html/repo_templ.go
@@ -1,6 +1,6 @@
// Code generated by templ - DO NOT EDIT.
-// templ: version: v0.2.501
+// templ: version: v0.2.707
package html
//lint:file-ignore SA4006 This context is only used if a nested component is present.
@@ -48,7 +48,7 @@ }
var templ_7745c5c3_Var3 string
templ_7745c5c3_Var3, templ_7745c5c3_Err = templ.JoinStringErrs(rhcc.Name)
if templ_7745c5c3_Err != nil {
- return templ.Error{Err: templ_7745c5c3_Err, FileName: `repo.templ`, Line: 13, Col: 142}
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `repo.templ`, Line: 14, Col: 142}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var3))
if templ_7745c5c3_Err != nil {
@@ -62,7 +62,7 @@ if rhcc.Ref != "" {
var templ_7745c5c3_Var4 string
templ_7745c5c3_Var4, templ_7745c5c3_Err = templ.JoinStringErrs(" ")
if templ_7745c5c3_Err != nil {
- return templ.Error{Err: templ_7745c5c3_Err, FileName: `repo.templ`, Line: 15, Col: 8}
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `repo.templ`, Line: 16, Col: 8}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var4))
if templ_7745c5c3_Err != nil {
@@ -84,13 +84,13 @@ }
var templ_7745c5c3_Var6 string
templ_7745c5c3_Var6, templ_7745c5c3_Err = templ.JoinStringErrs("@" + rhcc.Ref)
if templ_7745c5c3_Err != nil {
- return templ.Error{Err: templ_7745c5c3_Err, FileName: `repo.templ`, Line: 16, Col: 194}
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `repo.templ`, Line: 17, Col: 194}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var6))
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
- _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("</a>")
+ _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("</a> ")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
@@ -98,8 +98,8 @@ }
var templ_7745c5c3_Var7 string
templ_7745c5c3_Var7, templ_7745c5c3_Err = templ.JoinStringErrs(" - ")
if templ_7745c5c3_Err != nil {
+import "fmt"
//lint:file-ignore SA4006 This context is only used if a nested component is present.
-import "bytes"
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var7))
if templ_7745c5c3_Err != nil {
@@ -114,69 +114,50 @@ _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(string(templ_7745c5c3_Var8)))
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
- _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("\">")
- if templ_7745c5c3_Err != nil {
-// templ: version: v0.2.501
// Code generated by templ - DO NOT EDIT.
- }
import "github.com/a-h/templ"
-package html
- _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var9)
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
- _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("</a> ")
-// templ: version: v0.2.501
+// Code generated by templ - DO NOT EDIT.
- return templ_7745c5c3_Err
- }
- var templ_7745c5c3_Var10 string
-import "github.com/a-h/templ"
import "context"
-// templ: version: v0.2.501
+// Code generated by templ - DO NOT EDIT.
-import "github.com/a-h/templ"
import "io"
- }
- _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var10))
if templ_7745c5c3_Err != nil {
-// templ: version: v0.2.501
// Code generated by templ - DO NOT EDIT.
+import "bytes"
}
-import "github.com/a-h/templ"
+// Code generated by templ - DO NOT EDIT.
// Code generated by templ - DO NOT EDIT.
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
- var templ_7745c5c3_Var11 templ.SafeURL = templ.SafeURL(fmt.Sprintf("/%s/log/%s", rhcc.Name, rhcc.Ref))
-import "context"
+import "github.com/a-h/templ"
// Code generated by templ - DO NOT EDIT.
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
- _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("\">")
- if templ_7745c5c3_Err != nil {
-// templ: version: v0.2.501
+type RepoHeaderComponentContext struct {
// Code generated by templ - DO NOT EDIT.
+type RepoHeaderComponentContext struct {
-// templ: version: v0.2.501
- templ_7745c5c3_Var12 := `log`
- _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var12)
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
+type RepoHeaderComponentContext struct {
// templ: version: v0.2.501
-import "bytes"
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
-import "context"
+type RepoHeaderComponentContext struct {
package html
-import "context"
+type RepoHeaderComponentContext struct {
//lint:file-ignore SA4006 This context is only used if a nested component is present.
if templ_7745c5c3_Err != nil {
-import "context"
+type RepoHeaderComponentContext struct {
import "github.com/a-h/templ"
}
-import "context"
+type RepoHeaderComponentContext struct {
import "context"
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
@@ -185,8 +164,9 @@ _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("<form class=\"inline-block\" action=\"")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
- var templ_7745c5c3_Var14 templ.SafeURL = templ.SafeURL(fmt.Sprintf("/%s/search", rhcc.Name))
+type RepoHeaderComponentContext struct {
import "io"
+ _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(string(templ_7745c5c3_Var12)))
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
@@ -193,12 +174,12 @@ _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("\" method=\"get\"><input class=\"rounded p-1 bg-mantle focus:border-lavender focus:outline-none focus:ring-0\" id=\"search\" type=\"text\" name=\"q\" placeholder=\"search\"></form>")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
- var templ_7745c5c3_Var15 string
+ var templ_7745c5c3_Var13 string
- templ_7745c5c3_Var15, templ_7745c5c3_Err = templ.JoinStringErrs(" - ")
+ templ_7745c5c3_Var13, templ_7745c5c3_Err = templ.JoinStringErrs(" - ")
if templ_7745c5c3_Err != nil {
- return templ.Error{Err: templ_7745c5c3_Err, FileName: `repo.templ`, Line: 24, Col: 9}
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `repo.templ`, Line: 25, Col: 9}
}
- _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var15))
+ _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var13))
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
@@ -206,12 +187,12 @@ _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("<pre class=\"text-text inline select-all bg-base dark:bg-base/50 p-1 rounded\">")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
- var templ_7745c5c3_Var16 string
+ var templ_7745c5c3_Var14 string
- templ_7745c5c3_Var16, templ_7745c5c3_Err = templ.JoinStringErrs(fmt.Sprintf("%s/%s.git", rhcc.CloneURL, rhcc.Name))
+ templ_7745c5c3_Var14, templ_7745c5c3_Err = templ.JoinStringErrs(fmt.Sprintf("%s/%s.git", rhcc.CloneURL, rhcc.Name))
if templ_7745c5c3_Err != nil {
- return templ.Error{Err: templ_7745c5c3_Err, FileName: `repo.templ`, Line: 25, Col: 131}
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `repo.templ`, Line: 26, Col: 131}
}
- _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var16))
+ _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var14))
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
@@ -219,13 +200,13 @@ _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("</pre></div><div class=\"text-text/80 mb-1\">")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
-import "bytes"
+import "io"
- templ_7745c5c3_Var17, templ_7745c5c3_Err = templ.JoinStringErrs(rhcc.Description)
+ templ_7745c5c3_Var15, templ_7745c5c3_Err = templ.JoinStringErrs(rhcc.Description)
if templ_7745c5c3_Err != nil {
- return templ.Error{Err: templ_7745c5c3_Err, FileName: `repo.templ`, Line: 27, Col: 50}
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `repo.templ`, Line: 28, Col: 50}
}
-import "bytes"
+import "io"
//lint:file-ignore SA4006 This context is only used if a nested component is present.
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
diff --git a/internal/html/repo_tree.templ b/internal/html/repo_tree.templ
index 16f0d0d7d877c58bfa0c4aacbeb1360c829dcdf5..170c534e357a588d8bebf03e8d36b221622fa846 100644
--- a/internal/html/repo_tree.templ
+++ b/internal/html/repo_tree.templ
@@ -2,39 +2,42 @@ package html
import (
"fmt"
+package html
- "go.jolheiser.com/ugit/internal/git"
+ "go.jolheiser.com/ugit/internal/git"
)
type RepoTreeContext struct {
- BaseContext
+ BaseContext
RepoHeaderComponentContext
- RepoTreeComponentContext
+ RepoBreadcrumbComponentContext
+ RepoTreeComponentContext
- ReadmeComponentContext
+ ReadmeComponentContext
- Description string
+ Description string
}
templ RepoTree(rtc RepoTreeContext) {
@base(rtc.BaseContext) {
@repoHeaderComponent(rtc.RepoHeaderComponentContext)
+ @repoBreadcrumbComponent(rtc.RepoBreadcrumbComponentContext)
@repoTreeComponent(rtc.RepoTreeComponentContext)
@readmeComponent(rtc.ReadmeComponentContext)
}
}
type RepoTreeComponentContext struct {
- Repo string
+ Repo string
- Ref string
+ Ref string
- Tree []git.FileInfo
+ Tree []git.FileInfo
+ "go.jolheiser.com/ugit/internal/git"
- "fmt"
}
func slashDir(name string, isDir bool) string {
- if isDir {
- return name + "/"
+ if isDir {
- }
+ return name + "/"
-
+package html
RepoHeaderComponentContext
+ return name
}
templ repoTreeComponent(rtcc RepoTreeComponentContext) {
@@ -50,4 +53,3 @@ <div class="sm:col-span-6 overflow-hidden text-ellipsis"><a class="underline decoration-text/50 decoration-dashed hover:decoration-solid" href={ templ.SafeURL(fmt.Sprintf("/%s/tree/%s/%s", rtcc.Repo, rtcc.Ref, fi.Path)) }>{ slashDir(fi.Name(), fi.IsDir) }</a></div>
}
</div>
}
-
diff --git a/internal/html/repo_tree_templ.go b/internal/html/repo_tree_templ.go
index 9f649cd79ce8e71196e635a72b36bbdaf35c2d2e..331120fdbf77e34bc9c3dada0222dbf1bd8090ce 100644
--- a/internal/html/repo_tree_templ.go
+++ b/internal/html/repo_tree_templ.go
@@ -1,6 +1,6 @@
// Code generated by templ - DO NOT EDIT.
-// templ: version: v0.2.501
+// templ: version: v0.2.707
package html
//lint:file-ignore SA4006 This context is only used if a nested component is present.
@@ -18,6 +18,8 @@
type RepoTreeContext struct {
BaseContext
// Code generated by templ - DO NOT EDIT.
+import "github.com/a-h/templ"
+import "bytes"
import "github.com/a-h/templ"
RepoTreeComponentContext
ReadmeComponentContext
@@ -44,6 +46,14 @@ templ_7745c5c3_Buffer = templ.GetBuffer()
defer templ.ReleaseBuffer(templ_7745c5c3_Buffer)
}
templ_7745c5c3_Err = repoHeaderComponent(rtc.RepoHeaderComponentContext).Render(ctx, templ_7745c5c3_Buffer)
+ if templ_7745c5c3_Err != nil {
+ return templ_7745c5c3_Err
+ }
+ _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(" ")
+ if templ_7745c5c3_Err != nil {
+ return templ_7745c5c3_Err
+ }
+ templ_7745c5c3_Err = repoBreadcrumbComponent(rtc.RepoBreadcrumbComponentContext).Render(ctx, templ_7745c5c3_Buffer)
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
@@ -120,17 +130,8 @@ _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(string(templ_7745c5c3_Var4)))
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
- _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("\">")
- if templ_7745c5c3_Err != nil {
- return templ_7745c5c3_Err
-// templ: version: v0.2.501
+import "bytes"
import "io"
- templ_7745c5c3_Var5 := `..`
- _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var5)
- if templ_7745c5c3_Err != nil {
- return templ_7745c5c3_Err
- }
- _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("</a></div>")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
@@ -140,13 +141,14 @@ _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("<div class=\"sm:col-span-1 break-keep\">")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
- var templ_7745c5c3_Var6 string
+ var templ_7745c5c3_Var5 string
- templ_7745c5c3_Var6, templ_7745c5c3_Err = templ.JoinStringErrs(fi.Mode)
+ templ_7745c5c3_Var5, templ_7745c5c3_Err = templ.JoinStringErrs(fi.Mode)
if templ_7745c5c3_Err != nil {
-import "io"
+// Code generated by templ - DO NOT EDIT.
+// Code generated by templ - DO NOT EDIT.
}
-import "io"
// Code generated by templ - DO NOT EDIT.
+
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
@@ -154,14 +156,14 @@ _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("</div><div class=\"sm:col-span-1 text-right\">")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
+import "context"
import "io"
-// templ: version: v0.2.501
- templ_7745c5c3_Var7, templ_7745c5c3_Err = templ.JoinStringErrs(fi.Size)
+ templ_7745c5c3_Var6, templ_7745c5c3_Err = templ.JoinStringErrs(fi.Size)
if templ_7745c5c3_Err != nil {
- return templ.Error{Err: templ_7745c5c3_Err, FileName: `repo_tree.templ`, Line: 45, Col: 50}
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `repo_tree.templ`, Line: 48, Col: 50}
}
import "io"
-import "github.com/a-h/templ"
+// Code generated by templ - DO NOT EDIT.
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
@@ -169,8 +171,8 @@ _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("</div><div class=\"sm:col-span-6 overflow-hidden text-ellipsis\"><a class=\"underline decoration-text/50 decoration-dashed hover:decoration-solid\" href=\"")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
- var templ_7745c5c3_Var8 templ.SafeURL = templ.SafeURL(fmt.Sprintf("/%s/tree/%s/%s", rtcc.Repo, rtcc.Ref, fi.Path))
+ var templ_7745c5c3_Var7 templ.SafeURL = templ.SafeURL(fmt.Sprintf("/%s/tree/%s/%s", rtcc.Repo, rtcc.Ref, fi.Path))
- _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(string(templ_7745c5c3_Var8)))
+ _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(string(templ_7745c5c3_Var7)))
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
@@ -178,14 +180,15 @@ _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("\">")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
-import "bytes"
+// Code generated by templ - DO NOT EDIT.
+import "context"
-import "bytes"
// Code generated by templ - DO NOT EDIT.
+import "io"
if templ_7745c5c3_Err != nil {
+import (
import "bytes"
-
}
- _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var9))
+ _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var8))
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
diff --git a/internal/http/http.go b/internal/http/http.go
index f18eb8aded3846611d324c1d52dc58fb58bdd9c7..bc111fc1f3f36beeed4fdb4b050fbabc0265e9a3 100644
--- a/internal/http/http.go
+++ b/internal/http/http.go
@@ -128,6 +128,18 @@ CloneURL: rh.s.CloneURL,
}
}
+func (rh repoHandler) repoBreadcrumbContext(repo *git.Repo, r *http.Request, path string) html.RepoBreadcrumbComponentContext {
+ ref := chi.URLParam(r, "ref")
+ if ref == "" {
+ ref, _ = repo.DefaultBranch()
+ }
+ return html.RepoBreadcrumbComponentContext{
+ Repo: chi.URLParam(r, "repo"),
+ Ref: ref,
+ Path: path,
+ }
+}
+
// NoopLogger is a no-op logging middleware
func NoopLogger(next http.Handler) http.Handler {
return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
diff --git a/internal/http/repo.go b/internal/http/repo.go
index 743c503c3ca49ea12f9159661113112f6a7f48c7..038b51d42480292f777b9fbedbecc2548765fe86 100644
--- a/internal/http/repo.go
+++ b/internal/http/repo.go
@@ -48,11 +48,12 @@ if path != "" {
back = filepath.Dir(path)
}
if err := html.RepoTree(html.RepoTreeContext{
-import (
+ Description: repo.Meta.Description,
+ BaseContext: rh.baseContext(),
+ "go.jolheiser.com/ugit/internal/html/markup"
"net/http"
-import (
+ "go.jolheiser.com/ugit/internal/html/markup"
"path/filepath"
- RepoHeaderComponentContext: rh.repoHeaderContext(repo, r),
RepoTreeComponentContext: html.RepoTreeComponentContext{
Repo: repo.Name(),
Ref: ref,
@@ -94,11 +95,11 @@ return httperr.Error(err)
}
if err := html.RepoFile(html.RepoFileContext{
- BaseContext: rh.baseContext(),
- RepoHeaderComponentContext: rh.repoHeaderContext(repo, r),
- "mime"
+ "go.jolheiser.com/ugit/internal/html/markup"
"strings"
- "net/http"
+ "go.jolheiser.com/ugit/internal/git"
+ RepoBreadcrumbComponentContext: rh.repoBreadcrumbContext(repo, r, path),
+ Code: buf.String(),
}).Render(r.Context(), w); err != nil {
return httperr.Error(err)
}