Since you just posted a similar project, I wanted to ask whether you might have an idea how I can also assign a corresponding link to each image in the Markdown frontmatter when outputting random images.
The random image output itself is working fine so far. What I’m struggling with is correctly outputting the matching link for the selected image.
So far, I haven’t been able to reliably create a Twig syntax that also outputs the correct link for the corresponding image.
Do you perhaps have an idea how this could work? I’ve already adapted your example project the way I thought it should work.
I created a very small custom component, think this works ok, you can try, add more images, delete the span bit to not show link leave image as link only.
pulling image, url and alt from md file
That’s actually as far as I had already gotten. What I’m really trying to find is a way to solve this using the IMAGE component.
The random output of the image itself works without any problems. What I also want, though, is the correct matching URL for the image that gets displayed.
That’s the point where I’m stuck and can’t seem to get any further.