I think I’m missing something subtle (or maybe obvious) about the way arrays defined in front matter work.
I have a page with this data:
actions:
- actiontype: "code"
name: alice
- actiontype: "mentor"
name: bob
and a template that looks like this:
{{ range $action := .Params.Actions }}{{ $action.ActionType }}, {{end}}
{{ range .Params.Actions }}{{ .ActionType }}, {{end}}
{{ range (first 1 .Params.Actions) }}{{ .ActionType }}, {{end}}
{{ range $action2 := (first 1 .Params.Actions) }}{{ $action2.ActionType }}, {{end}}
this is the output I get:
code, mentor,
, ,
,
,
but I expected:
code, mentor,
code, mentor,
code,
code,
From reading the docs I kinda expected all of those to work. What am I missing? Thanks!