I am playing around with my figure
shortcode, trying to over-optimize everything, and am experiencing a weird situation.
The frontmatter:
resources:
- src: "celebrating-the-national-theatre-6753651837108751-2x.png"
name: "the-national-theatre"
title: "The National Theatre"
The call to the shortcode:
{{< figure name="the-national-theatre" >}}{{< /figure >}}
The part of the shortcode that calls the file:
{{ $image := .Page.Resources.GetMatch (printf "*%s*" (.Get "name")) }}
The result $image, debugged:
Name "celebrating-the-national-theatre-6753651837108751-2x.webp"
Title "celebrating-the-national-theatre-6753651837108751-2x.webp"
ResourceType "image"
Permalink "//localhost:1313/2020/12/google-doodle-des-tages-national-theater/celebrating-the-national-theatre-6753651837108751-2x.webp"
RelPermalink "/2020/12/google-doodle-des-tages-national-theater/celebrating-the-national-theatre-6753651837108751-2x.webp"
The foldercontent:
index.md < the file with the frontmatter and shortcode call
celebrating-the-national-theatre-6753651837108751-2x.webp
celebrating-the-national-theatre-6753651837108751-2x.png
Now… I would expect, because I explicitly state the name
of the resource, that Hugo returns the PNG image to me. Note, that I do NOT define resource info for the webp file. That file is just there (for future purposes).
What might be the reason that Hugo is returning the webp file name?