Should I use Data folder or Config.toml?

I’m working on a Hugo theme which has various content sections such as the page title, description etc.

In the past when creating themes I’ve always stored these in the config.toml, however recently I’ve started using the data folder and YAML files to store this data.

Config file advantages:

  • All the configurable text is stored in one place (easier for someone using the theme for the first time)

Data folder advantages:

  • No need to repeat yourself (in case you have multiple config files for different environments)

Which of these is the correct method?

I think you need to make the pragmatic choice as to what is best for you. There are stuff that have to be in config.toml (menus etc.; we have an issue that talks about “externalized config”), but I would try to keep that file as short as possible (no product catalogs etc.).

And the big advantage of /data vs config.toml is that it has theme support … There is currently no way to set a value in config.toml from a theme.

Thanks bep, I’m swaying towards using data as I believe this will also allow easier content management through Netlify CMS etc?