Why image resources are not working on taxonomy?

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
- - 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:

    {{ range .Pages }}
        {{ $image := .Resources.GetMatch (printf "%s" .Params.cover) }}
        {{ $image := $image.Resize "x220" }}
        <img src="{{ $image.RelPermalink }}" />
    {{ end }}

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!

create an _index.md with the same structure as your taxonomy.

eg. you have categories as taxonomy. then you create it here:


then you write the frontmatter field as usual.

title: Categories
cover: “image1.jpg”

The image also need to be put under:


More on Add custom metadata to a Taxonomy or Term