diff --git a/app/templates/home.templ b/app/templates/home.templ index be552f5..282ecdf 100644 --- a/app/templates/home.templ +++ b/app/templates/home.templ @@ -5,7 +5,7 @@ import ( ) templ Home(request *requests.Request, pc PageContext) { - @baseLayout(request, pc) { + @baseLayout(request, BaseLayoutContext{Title: pc.Title, ActivePage: "home"}) {
Bacon ipsum dolor amet venison bacon picanha jerky tenderloin. Hamburger sausage meatball chislic salami. Ball tip tenderloin chuck, venison strip steak kielbasa short loin bresaola short ribs cupim drumstick shoulder pork t-bone. Burgdoggen cupim meatball picanha meatloaf, jowl leberkas kevin. T-bone jowl ham hock salami tenderloin.
Beef ribs frankfurter corned beef ground round pork, sausage drumstick. Corned beef turducken beef ribs, tongue burgdoggen capicola kielbasa short loin pork belly tail frankfurter ribeye strip steak meatloaf. Alcatra frankfurter salami cupim strip steak leberkas jerky ham hock biltong swine ball tip prosciutto t-bone andouille. Pork loin hamburger chuck frankfurter ham shankle jowl sausage chislic chicken tenderloin. Capicola tongue beef ribs flank, doner sirloin tri-tip pastrami. Porchetta andouille pork fatback jerky, pancetta pig filet mignon leberkas kielbasa sirloin.
Biltong landjaeger drumstick meatball boudin pork chop turducken jerky hamburger filet mignon flank. Venison turducken pork belly, pork chop ground round buffalo strip steak ribeye alcatra pancetta flank salami chislic. Landjaeger flank andouille short ribs. Shoulder beef ribs chuck, corned beef frankfurter turducken prosciutto.
diff --git a/app/templates/home_templ.go b/app/templates/home_templ.go index e134bf0..5aaf7ce 100644 --- a/app/templates/home_templ.go +++ b/app/templates/home_templ.go @@ -87,7 +87,7 @@ func Home(request *requests.Request, pc PageContext) templ.Component { } return templ_7745c5c3_Err }) - templ_7745c5c3_Err = baseLayout(request, pc).Render(templ.WithChildren(ctx, templ_7745c5c3_Var2), templ_7745c5c3_Buffer) + templ_7745c5c3_Err = baseLayout(request, BaseLayoutContext{Title: pc.Title, ActivePage: "home"}).Render(templ.WithChildren(ctx, templ_7745c5c3_Var2), templ_7745c5c3_Buffer) if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } diff --git a/app/templates/layout.templ b/app/templates/layout.templ index 1a1566d..f69ddbb 100644 --- a/app/templates/layout.templ +++ b/app/templates/layout.templ @@ -4,7 +4,12 @@ import ( "fiber-sessions/app/router/requests" ) -templ baseLayout(request *requests.Request, pc PageContext) { +type BaseLayoutContext struct { + Title string + ActivePage string +} + +templ baseLayout(request *requests.Request, pc BaseLayoutContext) { diff --git a/app/templates/layout_templ.go b/app/templates/layout_templ.go index 41d5ae9..74aefa4 100644 --- a/app/templates/layout_templ.go +++ b/app/templates/layout_templ.go @@ -14,7 +14,12 @@ import ( "fiber-sessions/app/router/requests" ) -func baseLayout(request *requests.Request, pc PageContext) templ.Component { +type BaseLayoutContext struct { + Title string + ActivePage string +} + +func baseLayout(request *requests.Request, pc BaseLayoutContext) 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 { @@ -43,7 +48,7 @@ func baseLayout(request *requests.Request, pc PageContext) templ.Component { var templ_7745c5c3_Var3 string templ_7745c5c3_Var3, templ_7745c5c3_Err = templ.JoinStringErrs(pc.Title) if templ_7745c5c3_Err != nil { - return templ.Error{Err: templ_7745c5c3_Err, FileName: `app/templates/layout.templ`, Line: 15, Col: 20} + return templ.Error{Err: templ_7745c5c3_Err, FileName: `app/templates/layout.templ`, Line: 20, Col: 20} } _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var3)) if templ_7745c5c3_Err != nil { @@ -177,7 +182,7 @@ func baseLayout(request *requests.Request, pc PageContext) templ.Component { var templ_7745c5c3_Var13 string templ_7745c5c3_Var13, templ_7745c5c3_Err = templ.JoinStringErrs(request.User.FirstName) if templ_7745c5c3_Err != nil { - return templ.Error{Err: templ_7745c5c3_Err, FileName: `app/templates/layout.templ`, Line: 49, Col: 37} + return templ.Error{Err: templ_7745c5c3_Err, FileName: `app/templates/layout.templ`, Line: 54, Col: 37} } _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var13)) if templ_7745c5c3_Err != nil { diff --git a/app/templates/login.templ b/app/templates/login.templ index 7227475..c2e5586 100644 --- a/app/templates/login.templ +++ b/app/templates/login.templ @@ -54,7 +54,7 @@ templ LoginFormContent(content LoginFormValidationContent) { } templ RenderLogin(request *requests.Request, pc PageContext) { - @baseLayout(request, pc) { + @baseLayout(request, BaseLayoutContext{Title: pc.Title, ActivePage: "login"}) {