I have a branch bundle like this:
content/mailbox/
- _index.md
- mails/
- mail.md
- images/
- image.jpg
In mail.md
, I add img: image.jpg
in front matter. In the template file of mail.md
, I try to get this image using:
{{ with (printf "images/%s" .Params.img | .Resources.GetMatch) }}
or
{{ with (printf "images/%s" .Params.img | .Parent.Resources.GetMatch) }}
but neither of them work. I also try move the images
folder into mails
folder, still not work.
The only way is move the image.jpg
out of images
like this:
content/mailbox/
- _index.md
- image.jpg
- mails/
- mail.md
then I can get the image with .Parent.Resources.GetMatch
.
Is there any way I can get the image while keeping it inside folder?