From 78bb60c0dc42f50174437931fb1baa6fd70e2853 Mon Sep 17 00:00:00 2001 From: "Gerasimos (Makis) Maropoulos" Date: Sun, 15 Dec 2024 13:59:19 +0200 Subject: [PATCH] minor: trim suffix on executeTemplate --- blocks.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/blocks.go b/blocks.go index 7b9d04a..720e87e 100644 --- a/blocks.go +++ b/blocks.go @@ -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 {