Skip to content

Commit

Permalink
minor: trim suffix on executeTemplate
Browse files Browse the repository at this point in the history
  • Loading branch information
kataras committed Dec 15, 2024
1 parent 8f16b2b commit 78bb60c
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions blocks.go
Original file line number Diff line number Diff line change
Expand Up @@ -546,6 +546,9 @@ func (v *Blocks) ExecuteTemplate(w io.Writer, tmplName, layoutName string, data
}

func (v *Blocks) executeTemplate(w io.Writer, tmplName, layoutName string, data any) error {
tmplName = strings.TrimSuffix(tmplName, v.extension) // trim any extension provided by mistake or by migrating from other engines.
layoutName = strings.TrimSuffix(layoutName, v.extension)

if layoutName != "" {
tmpl := v.getTemplateWithLayout(tmplName, layoutName)
if tmpl == nil {
Expand Down

0 comments on commit 78bb60c

Please sign in to comment.