Hello! Please I need help with this, I can’t figure out why this is not working.
Let me explain a little bit, I have all my posts following this structure and with a cover in the Front Matter, for example:
Posts structure example
/content/post-1/
- - image1.jpg
- - image2.jpg
- - index.md
Front Matter on index.md:
—
title: “Qué hacer en Sevilla”
…
cover: “image1.jpg”
—
Then for example in my /themes/my-theme/layouts/index.html I can do:
<div>
{{ range .Pages }}
{{ $image := .Resources.GetMatch (printf "%s" .Params.cover) }}
{{ $image := $image.Resize "x220" }}
<img src="{{ $image.RelPermalink }}" />
{{ end }}
</div>
and works well!
But if I try to do the same in /themes/my-theme/layouts/_default/taxonomy.html, it doesn’t work. It gives me this error:
<$image.Resize>: nil pointer evaluating resource.Resource.Resize
What should I do to find that Resource from the post in this taxonomy.html file???
Thanks in advance!