Suppose I have this frontmatter data:
currency: '$'
products:
- item:
price:
I can range data from products array like this:
{{ range .products }}
{{ printf "%#v" .price }}
{{ end }}
The documentation - Introduction to templating - says:
Within a ‘range’ or ‘with’ block you can access the context passed into the template by prepending a dollar sign ($) to the dot:
{{ range .products }}
{{ printf "%#v" $.currency }}
{{ end }}
This throws an error: can’t evaluate field currency in type page.Page
But I can get data from the .Site level:
{{ range .products }}
{{ printf "%#v" $.Site.Params.currency }}
{{ end }}
Why can’t I get the data from .Params level, what am I doing wrong?