Is it possible to access the title of the image in markdown of content set like  in my list page?
What I’m trying to do is on my list page, I am displaying posts as cards with each post having a cover image (set using frontmatter). I am trying to show all the images in the posts as a slideshow in the cards. So, I was wondering if I can use the title (or any other way works too), to show like a caption below each image.
That would let me access in in the markdown content itself, right? I have that set-up and working correctly.
However, I’m asking if it’s possible in the 'list` (section) page? Check this page for example: https://v2--hrishikeshk.netlify.app/projects/. I have a user controlled slideshow working for the last 2 posts. It’s loading images like this:
<!-- Inside my range of posts -->
{{ range .Page.Resources.Match "img*.png" }} <!-- Loop through all images used in post -->
<li> <!-- Card slideshow image item -->
<img width = "1920" height = "1080" alt = "{{ . }}" data-src = "{{ .RelPermalink }}" uk-img> <!-- Card slideshow image/ -->
</li> <!-- /Card slideshow image item -->
{{ end }} <!-- /Loop through all images used in post -->
<!-- /Inside my range of posts -->
So, this is rendering the images in the section template. Right now, it accepts any image with the prefix img, which is fine. But, I was wondering if I can use only the images used in the markdown content without them needing any prefix and then access the title that I set using Markdown.
I don’t think you can do that. If I would be forced to implement it I would check the new post processing as option, but that is not easy, you would have to write a script that parses finished html files for their images and then add them to the index pages. That’s bound to fail somewhere.
If you can influence the project structure from the beginning try to add article images as page resource to the frontmatter (there adding a title) and then range through that information.
A (very hacky) version would be naming the files img-title-of-the-image.png, then substr-ing the first 4 and last 4 characters and humanize-ing the rest.
I think that this topic is very useful regarding accessing Markdown Render Hooks variables on a project’s list templates and for reference here is how I did what was described above by @bep
Within the image render hook template store whatever variables as needed in a slice with .Scratch.Add.
For example store a markdown image’s .PlainText like so: