Skip to content

file.SetContents ​

SetContents sets the contents of file being rendered to the value

This is useful for programmatic file generation within a template.

tpl
{{- file.SetContents "Hello, world!" }}