Currently I am picking up the cover image from the page/post from front matter. Wonder if there is a way to pick the first figure, image in the content itself?
{{ if isset .Params "img" }}
<img src="/images/{{ .Params.img }}" title="{{ .Params.img }} image" />
{{ end }}
Without doing some regex matching on .RawContent or .Content, you can split the summary manually:
Markdown
Aute pariatur sint sint adipisicing duis laborum aute ipsum excepteur officia.
![A kitten](a.jpg)
<!--more-->
Laboris excepteur sunt eiusmod duis dolore est dolore consectetur est fugiat id ad.
But if you decide to do this, you will need link and render hooks to properly resolve the destinations when displayed in a different context (i.e., a list instead of a single page).
Let me know if you decide to pursue this; I can provide the hooks.
I’ve managed to resolve it by checking the content for image links using regex and working with the first one that is returned. Note that your particular regex query depends on what type of content you have. The example below works on HTML image tags.