gohugo-theme-ananke icon indicating copy to clipboard operation
gohugo-theme-ananke copied to clipboard

Featured image in post tile

Open metbril opened this issue 3 years ago • 9 comments

In the posts view, each post is shown in a tile, three columns wide. Posts with a featured image show without image. It would be nice if the tile also shows that featured image.

metbril avatar Feb 19 '22 07:02 metbril

I also want the same.

LITUATUI avatar Mar 09 '22 13:03 LITUATUI

I can get that to work if I have it in the root of the posts. However, if I have it in its own directory, it does not show any image in the post tiles.
If I move a post into the root, the picture shows up in the post tile preview. I put it back in a sub directory (for its category) it has no picture. Is there a way to make this work for subdirs?

mettaisgood avatar May 04 '22 05:05 mettaisgood

First, the Ananke theme expects that your “posts” will be in content/post/ (singular) not content/posts/ (plural).

Second, to render featured images when viewing “post” list pages (regardless of depth):

mkdir -p layouts/post cp themes/ananke/layouts/post/list.html layouts/post/list.html Then edit layouts/post/list.html. Change this:

{{ .Render "summary" }} to this:

{{ .Render "summary-with-image" }}

I have confirmed this works. Issue should be close. Answer from https://discourse.gohugo.io/t/looking-for-theme-that-does-posts-previews-with-thumbnails-on-subdirectories/38472

I think the sample or directions should show this. I cannot tell you how long I have been searching for a theme that will do this out of the box.

bksubhuti avatar May 07 '22 10:05 bksubhuti

Ananke does this partially but not specifically in this situation. Don't close my issue because you think it should be. Unless you are the repo owner of course.

metbril avatar May 07 '22 15:05 metbril

You should adjust your original complaint or make a new one.

bksubhuti avatar May 08 '22 00:05 bksubhuti

Thanks guys! We'll review this later this week. Don't worry @metbril we don't close issues unless resolved by code fix or conversation.

regisphilibert avatar May 11 '22 15:05 regisphilibert

Tried this, unfortunately it doesn't work.

It used to be that in config.toml you could set featured_image to the path of the image you wanted and get the hero image for the site.

acgetchell avatar May 20 '22 18:05 acgetchell

I don't really like this feature. If it's added in the future, I'd like to have the option to keep it as is!

Pathsis avatar Jan 29 '23 04:01 Pathsis

cp themes/ananke/layouts/post/list.html layouts/post/list.html

doesn't work for me either

any other ideas would be appreciated

iandstanley avatar Apr 21 '23 00:04 iandstanley