package view import ( "fmt" "github.com/rjNemo/rentease/config" ) type HostViewModel struct { Name string Address string ZipCode string City string PhoneNumber string PhoneUrl templ.SafeURL Email string EmailUrl templ.SafeURL Items []Item } type Item struct { Name string Url templ.SafeURL } var host = config.NewHost() var hvm = &HostViewModel{ Name: host.Name, PhoneNumber: host.PhoneNumber, PhoneUrl: templ.SafeURL(fmt.Sprintf("tel:%s", host.PhoneNumber)), Email: host.Email, EmailUrl: templ.SafeURL(fmt.Sprintf("mailto:%s", host.Email)), Items: []Item{ {"T2 Corail", templ.URL("logements/t2")}, {"T3 Azur", templ.URL("logements/t3")}, }, } templ PublicLayout() { { hvm.Name } | Locations de vacances au Gosier en Guadeloupe
{ children... }
}