Skip to content

File Data Sources

Files are among the simplest data sources. The following file types are supported:

Files are identified by Contemplate using their file extension, and specified using the --file / -f command-line argument or the file prefix in the CONTEMPLATE_DATASOURCES environment variable

contemplate --file data.yml --file data.toml --file data.json
env CONTEMPLATE_DATASOURCES="file:data.yml,file:data.toml,file:data.json" contemplate

File data sources support live-reloading. When a file is changed, it will cause a re-render of the templates.