Edit: I don’t know how to get html to post as code in here. So I replace the code with gists.
Kind of a silly question, cause I feel like I should have figured this out by now. But I’ve come up short.
Essentially I have a credit: Photographer’s Name in my front matter. And I’d like to pass that into a caption, which is part of a shortcode right now that uses an image resizing template.
Right now:
And
{{< img src="200520142727.jpg" alt="" caption="Despite social distancing requirements, a crowd gathers along West Cliff Drive to get a view of the gray whale carcass being towed out to sea on Tuesday afternoon.">}}
That works…
But I’d like a pass a credit front matter if it’s available.
Soo something like…
But I can’t seem to pass a front matter variable to the image processing template. And since the figure tag is rendered from the shortcode, there’s now a way to inject that into the caption. Ultimately I’d like to pull the caption and credit from the exif data and if it’s not available, use the front matter and caption in the shortcode.
Thanks. Pretty excited about Hugo so far.