Which method to access values from TOML data?

The data keys are strings, but now.Year is an integer. Try it:

{{ printf "%T" now.Year }} 

Note that bare keys are allowed to be composed of only ASCII digits, e.g. 1234 , but are always interpreted as strings.

https://toml.io/en/v1.0.0#keys

Regarding site vs .Site… search this forum. Example:
https://discourse.gohugo.io/t/site-vs-site-any-performance-advantages-of-either/29973/2

1 Like