From 65b85c3d16e138388ca8b4ec6bacba80ad012ccb Mon Sep 17 00:00:00 2001 From: Dustin Pianalto Date: Thu, 6 Mar 2025 14:58:12 -0900 Subject: [PATCH] fix templ templates --- web/templates/index.templ | 4 +--- web/templates/index_templ.go | 37 +++++++++++++++--------------------- 2 files changed, 16 insertions(+), 25 deletions(-) diff --git a/web/templates/index.templ b/web/templates/index.templ index f94d10a..1bafc1b 100644 --- a/web/templates/index.templ +++ b/web/templates/index.templ @@ -1,7 +1,5 @@ package templates -import "track-gopher/derby" - templ Index() { @@ -23,7 +21,7 @@ templ Index() {
- { laneComponents() } + @laneComponents()
diff --git a/web/templates/index_templ.go b/web/templates/index_templ.go index db164f3..0debac7 100644 --- a/web/templates/index_templ.go +++ b/web/templates/index_templ.go @@ -8,8 +8,6 @@ package templates import "github.com/a-h/templ" import templruntime "github.com/a-h/templ/runtime" -import "track-gopher/derby" - func Index() templ.Component { return templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) { templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context @@ -35,12 +33,7 @@ func Index() templ.Component { if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } - var templ_7745c5c3_Var2 string - templ_7745c5c3_Var2, templ_7745c5c3_Err = templ.JoinStringErrs(laneComponents()) - if templ_7745c5c3_Err != nil { - return templ.Error{Err: templ_7745c5c3_Err, FileName: `web/templates/index.templ`, Line: 26, Col: 22} - } - _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var2)) + templ_7745c5c3_Err = laneComponents().Render(ctx, templ_7745c5c3_Buffer) if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } @@ -68,9 +61,9 @@ func laneComponents() templ.Component { }() } ctx = templ.InitializeContext(ctx) - templ_7745c5c3_Var3 := templ.GetChildren(ctx) - if templ_7745c5c3_Var3 == nil { - templ_7745c5c3_Var3 = templ.NopComponent + templ_7745c5c3_Var2 := templ.GetChildren(ctx) + if templ_7745c5c3_Var2 == nil { + templ_7745c5c3_Var2 = templ.NopComponent } ctx = templ.ClearChildren(ctx) for i := 1; i <= 4; i++ { @@ -99,21 +92,21 @@ func laneComponent(lane int) templ.Component { }() } ctx = templ.InitializeContext(ctx) - templ_7745c5c3_Var4 := templ.GetChildren(ctx) - if templ_7745c5c3_Var4 == nil { - templ_7745c5c3_Var4 = templ.NopComponent + templ_7745c5c3_Var3 := templ.GetChildren(ctx) + if templ_7745c5c3_Var3 == nil { + templ_7745c5c3_Var3 = templ.NopComponent } ctx = templ.ClearChildren(ctx) templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 3, "