Skip to content
This repository has been archived by the owner on Feb 24, 2024. It is now read-only.

Commit

Permalink
allows n number of yields in templates
Browse files Browse the repository at this point in the history
  • Loading branch information
markbates committed Jun 27, 2017
1 parent a5913b5 commit fd318dc
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 5 deletions.
5 changes: 1 addition & 4 deletions render/html.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,9 @@ func HTML(names ...string) Renderer {
// in the options, then that layout file will be used
// automatically.
func (e *Engine) HTML(names ...string) Renderer {
if e.HTMLLayout != "" {
if e.HTMLLayout != "" && len(names) == 1 {
names = append(names, e.HTMLLayout)
}
if len(names) > 2 {
names = names[:2]
}
hr := templateRenderer{
Engine: e,
contentType: "text/html",
Expand Down
1 change: 0 additions & 1 deletion render/template.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ func (s templateRenderer) Render(w io.Writer, data Data) error {
var body template.HTML
var err error
for _, name := range s.names {

body, err = s.exec(name, data)
if err != nil {
return err
Expand Down

0 comments on commit fd318dc

Please sign in to comment.