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.

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