Files
go-htmx-templ/app/handlers/about.go
Eden Kirin 26635bbff1 Full demo
2024-01-21 11:01:31 +01:00

63 lines
1.1 KiB
Go

package handlers
import (
"templ-tests/app/templates"
"templ-tests/app/types"
"github.com/gin-gonic/gin"
)
var catFacts []types.CatFact = []types.CatFact{
{
Breed: "Abyssinian",
Country: "Ethiopia",
Origin: "Natural/Standard",
Coat: "Short",
Pattern: "Ticked",
},
{
Breed: "Aegean",
Country: "Greece",
Origin: "Natural/Standard",
Coat: "Semi-long",
Pattern: "Bi- or tri-colored",
},
{
Breed: "American Curl",
Country: "United States",
Origin: "Mutation",
Coat: "Short/Long",
Pattern: "All",
},
{
Breed: "American Bobtail",
Country: "United States",
Origin: "Mutation",
Coat: "Short/Long",
Pattern: "All",
},
{
Breed: "American Shorthair",
Country: "United States",
Origin: "Natural",
Coat: "Short",
Pattern: "All but colorpoint",
},
{
Breed: "American Wirehair",
Country: "United States",
Origin: "Mutation",
Coat: "Rex",
Pattern: "All but colorpoint",
},
}
func About(c *gin.Context) {
pc := templates.PageContext{
Title: "Welcome to the demo - About",
ActivePage: "about",
}
templates.About(pc, catFacts).Render(c, c.Writer)
}