From e57dcd3795b80584354656b440534b42f7bb5684 Mon Sep 17 00:00:00 2001 From: Andreas Deininger Date: Mon, 26 May 2025 17:40:02 +0200 Subject: [PATCH] Improve warning message on superfluous prefix when using function 'partials.Include' --- tpl/partials/partials.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tpl/partials/partials.go b/tpl/partials/partials.go index 19882e36a..57a2aa280 100644 --- a/tpl/partials/partials.go +++ b/tpl/partials/partials.go @@ -133,7 +133,7 @@ func (ns *Namespace) lookup(name string) (*tplimpl.TemplInfo, error) { if strings.HasPrefix(name, "partials/") { // This is most likely not what the user intended. // This worked before Hugo 0.146.0. - ns.deps.Log.Warnidf(constants.WarnPartialSuperfluousPrefix, "Partial name %q starting with 'partials/' (as in {{ partial \"%s\"}}) is most likely not what you want. Before 0.146.0 we did a double lookup in this situation.", name, name) + ns.deps.Log.Warnidf(constants.WarnPartialSuperfluousPrefix, "Doubtful use of partial function in {{ partial \"%s\"}}), this is most likely not what you want. Consider removing superfluous prefix \"partials/\" from template name given as first function argument.", name) } v := ns.deps.TemplateStore.LookupPartial(name) if v == nil {