23 lines
365 B
Go
23 lines
365 B
Go
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).Render(c, c.Writer)
|
|
}
|