feat: add raw func and allow using funcs in output name

This commit is contained in:
Justin Lin committed 2025-07-25 13:19:16 +10:00
1 parent a2c99c710e
commit d4e85844a4
5 files changed
+158 -62

No files matched your search

+3 -5
View File
@@ -33,14 +33,12 @@ func main() {
ctx, err := parseParams(templateMeta)
handleError(err)
data := render(body, ctx)
output, err := templateMeta.OutputFile(ctx)
output, err := ctx.OutputFile(templateMeta)
handleError(err)
defer output.Close()
err = os.WriteFile(output, data, 0644)
err = ctx.render(body, output)
handleError(err)
fmt.Printf("Result saved to %s\n", output)
}
func loadTemplate() (string, error) {