Range page resources in front matter

I have a situation where I have to range over an src array inside resources in front matter. But I am having a hard time figuring out how to do it. I have given the code below. And also, is this the right way to approach this problem? Any suggestions will be helpful.

resources:

  • name: main
    src: ‘kitchen-nightmares.jpg’
  • src: [‘amys-baking-company.jpg’, ‘Levantis-Italian-Restaurant.jpg’, ‘Mill-Street-Bistro.jpg’, …]

You don’t need to specify the sec unless you have additional metadata.

To iterate images, do

{{ range .Resources.ByType “image” }}

{{ end }}
1 Like

I have been doing it wrong all along. Thank you :slightly_smiling_face:

1 Like

This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.