start theme cup templates

This commit is contained in:
Zeni Kim 2024-10-07 18:12:28 -05:00
parent 1b6f3e6103
commit f80c062099
11 changed files with 202 additions and 48 deletions

View file

@ -24,16 +24,22 @@ func WelcomeHome(c *core.Context) *core.Response {
TemplateEnable, _ := strconv.ParseBool(TemplateEnableStr)
if TemplateEnable {
// first, include all compoments
type templateData struct {
TheTitle components.Title
PageCard components.PageCard
}
// now fill data of the components
tmplData := templateData{
TheTitle: components.Title{
Label: "Welcome to Goffee",
PageCard: components.PageCard{
CardTitle: "Golang Framework",
CardBody: "Welcome to Goffee",
},
}
return c.Response.Template("basic.html", tmplData)
return c.Response.Template("welcome.html", tmplData)
} else {
message := "{\"message\": \"Welcome to Goffee\"}"
return c.Response.Json(message)