Trying to get resources from headless page

I am trying to display an image that is defined in the front matter of a headless page.

The .md file:

title: "title"
headless: true
resources :
- src: "/path/to/the/image.png"
  name: "authorimage"
  title: "title"
... content...

The template:

{{ with .Site.GetPage "sitewide/" }}
<div class="card mb-5">
	{{ with (.Resources.GetMatch "authorimage") }}
		<figure class="authorimage img-fluid">
			<img src="{{ .Permalink }}" style="width:100%;height:auto;" alt="{{ .Title }}" class="card-img-top">
			<figcaption>{{ .Title }}</figcaption>
	{{ end }}
	<div class="card-body">
		<h3 class="card-title">{{ .Title }}</h3>
		<div class="card-text">
			{{ .Content }}
{{ end }}

The whole loop {{ with (.Resources.GetMatch "authorimage") }} is not running (returns nothing).

Could it be that it’s not possible to retrieve resources in headless pages?

I “debugged” it by using

{{ printf "%#v" .Resources }}

and got a resounding resource.Resources(nil).

So, it looks like headless page bundles have no resources. Sad. :wink:

This might have been my own fault. I achieved what I wanted (adding an article image to a headless page) via frontmatter parameters now. The content page itself was no page bundle and I think that might have been the underlying issue. Only page bundles have resources. I will write that 100 times on my blackboard.