Hi there,
I am getting some troubles to access a page resource.
In my frontmatter, I defined a ressource called cover as follow
[[resources]]
name = "cover"
src = "discover.jpg"
title = "my cover title"
In my template, following code works perfectly :
{{ with .Resources.GetMatch "cover" }}
{{ .RelPermalink }}
{{ end }}
However this code is not working and I do not understand why
{{ $image:= (.Resources.GetMatch "cover") }}
{{ $image.RelPermalink }}
Here is the error I get :
execute of template failed: template: blog/single.html:33:17: executing "main" at <$image.RelPermalink>: nil pointer evaluating resource.Resource.RelPermalink
I am using Hugo v0.74.3/extended.
Is there an explanation for this ?