have two base layouts base.tmpl and auth.tmpl
I have pages that "extend" these layouts. E.g index.tmpl extends base and login.tmpl extends auth.
No matter what route I visit, the last alphabetical template is always rendered in the layout. What's going wrong here?
e.g if I visit login, it should render login.tmpl within auth.tmpl, but register.tmpl is rendered instead.
I've trimmed it down to one base layout, and now whatever page I visit, I get the contents of register.tmpl. (register.tmpl is alphabetically the last template) In case it is of any use, I'm using Go 1.14.2. If anyone could even point me in the right direction, that would be great, I don't even know what to search for at this point.
can’t tell, you didn’t show any code, could be anything
Go 1.15.5 is latest, use the latest.
My templates are similar to the following base.tmpl: {{ define "base" }} <html> ... {{ template "main" . }} ... </html> {{ end }} index.tmpl: {{ template "base" . }} {{ define "main" }} ... {{ end }} main.go: import "html/template" ... template.Must(template.ParseGlob("views/*/*.tmpl"))
I will upgrade my installation.
Обсуждают сегодня