From b94eb82d12e12559d3c3b9622797ff684a12707a Mon Sep 17 00:00:00 2001 From: Fabian Ruff Date: Mon, 1 May 2017 02:00:09 +0200 Subject: [PATCH] Skip rendering partials The output of a rendered partial is not used and rendering it might fail if it expects different values --- pkg/engine/engine.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/pkg/engine/engine.go b/pkg/engine/engine.go index ab813968f..37e32ece3 100644 --- a/pkg/engine/engine.go +++ b/pkg/engine/engine.go @@ -193,6 +193,11 @@ func (e *Engine) render(tpls map[string]renderable) (map[string]string, error) { rendered := make(map[string]string, len(files)) var buf bytes.Buffer for _, file := range files { + // Don't render partials. We don't care out the direct output of partials. + // They are only included from other templates. + if strings.HasPrefix(path.Base(file), "_") { + continue + } // At render time, add information about the template that is being rendered. vals := tpls[file].vals vals["Template"] = map[string]interface{}{"Name": file, "BasePath": tpls[file].basePath}