Add namespaces and include tag, improve whitespace handling

This commit is contained in:
2023-10-29 15:47:47 -07:00
parent fb7010dae3
commit 76c0a48b87
12 changed files with 372 additions and 162 deletions

View File

@@ -56,15 +56,14 @@ func main() {
"page": Page{Title: "Users"},
}
t, err := salix.New().
WithVarMap(vars).
WithEscapeHTML(true).
ParseString("readme.salix.html", tmpl)
t, err := salix.New().ParseString("readme.salix.html", tmpl)
if err != nil {
log.Fatalln(err)
}
err = t.Execute(os.Stdout)
err = t.WithVarMap(vars).
WithEscapeHTML(true).
Execute(os.Stdout)
if err != nil {
log.Fatalln(err)
}