Hi,
with this code I grab an image from a page bundle.
I link a resource from frontmatter.
{{ $img := (.Resources.ByType "image").GetMatch "featured-image" }}
{{ with $img }}
{{ partial "tools/img" (dict "img" . "alt" $img.Title ) }}
{{ end }}
Frontmatter
resources:
- name: featured-image
src: ImageName.jpg
I’m trying to cut the image file extension from: ImageName.jpg to ImageName to put it in the “alt” tag. Which approach do you recommend? Any advice?