files compiles ok

This commit is contained in:
Bel LaPointe
2022-02-15 14:34:10 -07:00
parent 464ea7bf51
commit 931c3bdda8
5 changed files with 61 additions and 50 deletions

View File

@@ -119,11 +119,17 @@ newlines
tmpl := t(p)
defer log.Printf("rendering %s (...%s) as %s", templateToExecute, path.Join(path.Base(path.Dir(p)), path.Base(p)), target)
if strings.HasPrefix(templateToExecute, "_") {
testTemplate := `{{ define "test" }}`
testTemplate := `
{{ define "test" }}
<body class="fullscreen" style="border: 10px solid red;">
`
for _, subtemplate := range always {
testTemplate += fmt.Sprintf(`{{ template %q . }}`, subtemplate)
}
testTemplate += fmt.Sprintf(`{{ template %q . }}{{ end }}`, templateToExecute)
testTemplate += `
</body>
`
tmpl = template.Must(tmpl.Parse(testTemplate))
templateToExecute = "test"
}