site.Data and image resource not found

Hi, i have a book list as JSON, from which I extract the titles and the path to the cover-image.

[{
"Title":"My Title 1",
"CoverImagePath": "images/test.png"
},{
"Title":"My Title 2",
"CoverImagePath": "images/test.png"
}]
  • The Test-Image is located at assets/images/test.png .

The title is listed, but the image is not displayed.
The print shows . What am I doing wrong here?

{{ $book_list := site.Data.books }} 
{{ range $book_list }}
  {{ $my_img := .resources.Get .CoverImagePath }}
  {{ print $my_img }}
       Titel: {{ .Title }} <br/>
       <img src="{{ $my_img.RelPermalink }}" ><br/>
{{ end }}

Every tip is welcome.
Best regards

it has to be resources.Get …it’s always the dots :slight_smile:

This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.