Skip to content


If a directory called .chezmoitemplates exists, then all files in this directory are available as templates with a name equal to the relative path to the .chezmoitemplates directory.

The template action can be used to include these templates in another template. The value of . must be set explicitly if needed, otherwise the template will be executed with nil data.



{{ if true }}bar{{ end }}
{{ template "foo" . }}

The target state of .file will be bar.