How to Set an Image as the Post Excerpt? #9128
-
I'm trying to find a way to set an image as my post excerpt. The idea is that I can pick the best image from the post as the excerpt rather than just the first section of the post. I have tried putting the image in the Excerpt property in the front matter, however it seems only text works for this field because it errors out, seemingly due to the "!" character. I know there is also the excerpt separator property, but this only allows an endpoint to be defined for the excerpt but not the startpoint. I then tried to add this functionality using the method outlined here https://cjshelton.github.io/blog/2019/05/27/customising-jekyll-excerpt-start.html Does anyone know of a better way to pick a given image from the post as the excerpt? |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 1 reply
-
How about, in the front matter:
and where you want to render it:
|
Beta Was this translation helpful? Give feedback.
-
Technically, an image is not an excerpt of an article. But that could just be my opinionated view. |
Beta Was this translation helpful? Give feedback.
How about, in the front matter:
and where you want to render it: