pollo/pages/home.go

26 lines
432 B
Go
Raw Normal View History

2023-05-18 20:04:55 -06:00
package pages
import (
2024-06-27 13:13:46 -06:00
"pollo/lib"
2024-06-27 21:23:51 -06:00
"github.com/labstack/echo/v4"
2023-05-18 20:04:55 -06:00
)
type HomeProps struct {
2024-06-27 21:23:51 -06:00
IsLoggedIn bool
2023-05-18 20:04:55 -06:00
}
func Home(c echo.Context) error {
2024-06-27 21:23:51 -06:00
props := HomeProps{
IsLoggedIn: lib.IsSignedIn(c),
}
println("Home page props: ", props.IsLoggedIn)
2023-05-18 20:04:55 -06:00
// Specify the partials used by this page
2024-06-27 13:13:46 -06:00
partials := []string{"header"}
2023-05-18 20:04:55 -06:00
// Render the template
return lib.RenderTemplate(c.Response().Writer, "base", partials, props)
}