Hello,
I’m trying to access the image associated with a taxonomy I’ve called “albums”, but it’s not appearing. I am able to pull the title from the _index.md
meta data, however.
I’ve structured my albums taxonomy content like this:
content/albums
├── album-1
│ ├── _index.md
│ └── header.png
└── album-2
├── _index.md
└── header.png
And I am trying to access the data in a home.html
template like this:
{{ $albums := "albums" }}
{{ with ($.Site.GetPage (printf "/%s" $albums)) }}
{{ range .Pages }}
{{ $headerResource := .Resources.GetMatch "header.png" }}
<article>
<a href="{{ .Permalink }}">
<h3>{{ .Title }}</h3>
<img src="{{ $headerResource.Permalink }}" alt="">
</a>
</article>
{{ end }}
{{ end }}
I’ve tried a several different approaches but just can’t seem to get anything but nil
returning for $headerResource
.
Any help would be greatly appreciated.
Thanks in advance!