A few notes:
- Your front matter param
dataFilehad an incorrect value. Change it fromdonuttoXYZ - Your
XYZ.ymllisted images that did not exist in the branch bundle, so you would never get a match in your looping. So add one that does, e.g.01.jpg - Since you’re using a branch bundle for your images, then the images must live in the same directory as the
_index.md, so I moved them accordingly - To prevent the
nilerror, wrapped your image logic in awith - Instead of using the bundle image name as the image source, used the
.Permalink - I left the debug lines in there so that you can see what is actually happening. Obviously remove them at some point
{{ with .Params.dataFile }}
<ul class="gallery">
{{ $data := index $.Site.Data.shows . }}
{{ $data }} <!-- debug -->
{{ range $.Resources.ByType "image" }}
{{ $bundleImg := . }}
{{ $bundleImg.Name }} <!-- debug -->
{{ range $data.media.images }}
{{ . }} <!-- debug -->
{{ if eq $bundleImg.Name .}}
Equals {{ . }} <!-- debug -->
<li><img src="{{ $bundleImg.Permalink }}" /></li>
{{ end }}
{{ end }}
{{ end }}
</ul>
{{ end }}