assuming $author is a page object you can use Resources.Get with the full path in the page bundle or Resources.GetMatch with a glob pattern avatar*.jpg which returns the first match.
if that does not work, you may want to share the stuff around. folder structure $uthor source, template
{{ range .Params.authors }}
{{ with $.Site.GetPage (printf "authors/%s/" .) }}
{{ with $r := .Resources.GetMatch "avatar" }}
{{ with .Fill "300x300" }}
<img alt="{{ $r.Name }}" class="img img-raised" src="{{ .RelPermalink }}">
{{ end }}
{{ end }}
{{ end }}
{{ end }}
Works for me. Try it:
git clone --single-branch -b hugo-forum-topic-53483 https://github.com/jmooring/hugo-testing hugo-forum-topic-53483
cd hugo-forum-topic-53483
hugo server
I tried to implement your code but it still doesn’t return anything. Nor locally, or in CloudFlare pages.
Here is the resulting page, where I can fetch the header for the current page but not the avatar of the getPage function. The Dawn of Truly Personalized Learning