mirror of
https://github.com/lancatlin/mdsh.git
synced 2026-11-06 03:30:13 +08:00
feat: add raw func and allow using funcs in output name
This commit is contained in:
1 parent
a2c99c710e
commit
d4e85844a4
5 files changed
+158
-62
No files matched your search
@@ -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) {
|
||||
|
||||
Reference in new issue
Block a user