I’m stuck at getting dates to render in the YYYY-MM-DD form. Ideally, I would like to do this globally in config.toml and avoid setting it in templates. Using the magic 2006-01-02 fails.
The configuration for frontmatter is not used to configure date formats. This tells Hugo how to “calculate” or assign date values to the various date page variables.
Take this config line for example:
[frontmatter]
date = ["date", "publishDate", "lastmod"]
This tells Hugo that if you reference {{ .Date }} from within a Page context, it will first look at whether that Page has date specified in its frontmatter. If not, it will look at whether publishDate is specified. If not, then check lastmod value.
^ is exactly how to tell Hugo how to display your various dates.
If you want to make it a site-wide config value, what you could do is add a param in your config: