timber / starter-theme

The "_s" for Timber: a dead-simple theme that you can build anything from
MIT License
818 stars 278 forks source link

Empty img element when there is no featured image #117

Open rmens opened 3 years ago

rmens commented 3 years ago

When a post has no featured image, there is an empty <img src=""> element in each single post. Singe.twig seems to assume there is always a featured image on a post, which is not always true. There should probably be a check on that.

jarednova commented 3 years ago

Great call @rmens! Seems like it's a quick fix, but I want to give you first crack at the PR opportunity. Could you handle the fame and glory?

AshleyRedman commented 3 years ago

I feel that this sort of thing is project-specific. It's very simple to add a conditional to render this if a featured image is present or not, and as a starter theme, it does assume a featured image would be present. Similarly, it is project-specific that you may define a default featured image if one isn't selected as well as any other attr that the image may have.

Levdbas commented 10 months ago

I think A small check to add to a single page is not really that hard to do and gives a good example. I will mark this as an enhancement.