Suppose I have an image link in the post body like ![image](https://i.postimg.cc/26fT2WHW/1.png). I have access to front matter in such a way that I can add
---
...
image: here a default value, can't change
...
---
I need to place https://i.postimg.cc/26fT2WHW/1.png where the text appeared like here a default value, can't change. But I can’t use https://i.postimg.cc/26fT2WHW/1.png directly there. Any solution, please reply.
@rdyar For some reason I can’t directly insert link https://i.postimg.cc/26fT2WHW/1.png in the front matter. I can Only put a default value(if available) that should be same for all posts. @chuckhoupt, No that’s not I meant.
@rdyar I am in a situation that I have no direct access to front matter of posts. I can preset a value in front matter of posts which will unique for all posts. I can’t put image url everytime, Is there a way to grab the image url from post body and access it in front matter by using a unique value (Some times liquid - I know liquid not allowed infront matter, may have workarounds). Then I can access it in post excerpt or somewhere in the index file by using {{post.image}} tag. @chuckhoupt You are near to that, any more suggestions
Possibly you could use the Post Excerpts feature to isolate the part of the post with the image? But maybe that isn’t enough.
If I understand correctly, you’d like to have automatic access to the the src URL of the first image in every post – sort of an image-excerpt for posts? Although you can use a work-around in Liquid, I think a custom plugin in Ruby might be a better route.
This is not possible with Vanilla Jekyll.
Jekyll does not process the body first and then the front matter. The entire document is parsed in a single pass.