Full demo

This commit is contained in:
Eden Kirin
2024-01-21 11:01:31 +01:00
parent 42ac91ce64
commit 26635bbff1
11 changed files with 292 additions and 62 deletions

View File

@ -2,14 +2,21 @@ package handlers
import (
"templ-tests/app/templates"
"templ-tests/app/types"
"github.com/gin-gonic/gin"
)
func Home(c *gin.Context) {
user := types.User{
FirstName: "Pero",
LastName: "Perić",
}
pc := templates.PageContext{
Title: "Welcome to the demo",
ActivePage: "home",
User: &user,
}
templates.Home(pc, "World").Render(c, c.Writer)
templates.Home(pc).Render(c, c.Writer)
}