Images error - can't evaluate field MediaType in type string #467
Unanswered
pensivedog
asked this question in
Support
Replies: 1 comment 5 replies
-
Why define which image to show, if you can put {{- $images := .Resources.ByType "image" -}}
{{- $featured := $images.GetMatch "*feature*" -}}
{{- if not $featured }}{{ $featured = $images.GetMatch "{*cover*,*thumbnail*}" }}{{ end -}}
{{- if $featured -}}
{{ partial "picture" (dict
"page" .
"src" $featured
"alt" .Title
"class" "my-classes"
"fetchpriority" "high"
"loading" "eager"
"sizes" "auto"
)}}
{{ end -}} |
Beta Was this translation helpful? Give feedback.
5 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
After upgrading an existing Hyas site to use Hugo 0.123.7, I get the following error:
My images are in page bundles and the call in my single template looks like this:
Beta Was this translation helpful? Give feedback.
All reactions