Golang noob, learning by doing but hit a wall. I want to set some page resource params in frontmatter, then use them in a shortcode:
Frontmatter:
!snip!
[[resources]]
name=“RAE415”
src=“RAE415.jpg”
[resources.params]
caption=“Olympia RAE 4/15 (1964)”
+++
(Minimal test) Shortcode:
{{ $res := .Page.Resources.GetMatch (.Get “resname”) }}
{{ $res }}
{{ $res.params.caption }}
Call with: {{% minimaltest resname=“RAE415” %}}
The first two lines of the code seem to work OK and a sensible-looking name is output
Adding the third line gives a failed to render shortcode error:
<$res.params.caption>: params is an unexported field of struct type resource.Resource
I cannot figure out what/where is the mismatch. Tried lots of variations, but clearly there is a gap in my Golang concepts. Very grateful for a codefix or pointer to an explanation of the concept I’m missing.