flosch / pongo2

Django-syntax like template-engine for Go
https://www.schlachter.tech/pongo2
MIT License
2.86k stars 269 forks source link

What tags deos pongo uses of declared structs struct? #345

Open chauhan17nitin opened 7 months ago

chauhan17nitin commented 7 months ago

Suppose i have a struct like below

type Person struct {
Name string `json:"name"`
}

Now when wrapping my response in pongo context like below

dataContext := pongo2.Context{
    "person": person,
}

ctx.HTML(200, "user.html", dataContext)

in the HTML

{{person.name}} will not work, only {{person.Name}} works which means pongo using default fields names of struct.

Is there any way i can specify my field name manually for this?