forked from goffee/cup
start theme cup templates
This commit is contained in:
parent
1b6f3e6103
commit
f80c062099
11 changed files with 202 additions and 48 deletions
|
|
@ -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)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue