Display resources’ title only if set in front matter

#1

Hi all!

I would like to display the page resources’ titles, but only if changed via front matter.

Technically it is no problem. But is this really the correct way?

Thank you!

Front matter:

resources:
- src: 1.jpg
  title: My title

Layout file:

{{ range .Resources }}
  {{ if ne .Title .Name }}{{ .Title }}{{ end }}
{{ end }}
0 Likes