eddiesigner / liebling

Beautiful and clean Ghost theme that is easy and comfortable to use. To get the latest version please head over the releases page 👉🏼
https://github.com/eddiesigner/liebling/releases
MIT License
1.26k stars 598 forks source link

Hero image or image in article card doesn't show alt text value #440

Closed kumarvikram closed 2 years ago

kumarvikram commented 2 years ago

Even though I set the alt text on hero image while creating the post, it doesn't appear after publishing. It is always blank. Checked in hero.hbs of the theme and found it is not reading the alt value and setting it to empty always. image

How to resolve this?

Images in article cards on home page have similar issue but I couldn't find the source of it. I am new to ghost and this ecosystem, so any help will be appreciated.

abarajithan11 commented 2 years ago

I had an issue with the hero image srcset, due to the wget -k command I was using to fetch the static site. I edited the hbs file such that the whole <img ... /> is in the same line. That fixed the issue. It may help

kumarvikram commented 2 years ago

@abarajithan11 Thanks. Can you guide me on how to set the alt attribute dynamically on this image tag? I believe the alt attribute is getting saved with post but I am not sure how to retrieve it.

Is there any helper like img_url to read the alt attribute of the image?

abarajithan11 commented 2 years ago

I'm not sure about it. I haven't tried that

eddiesigner commented 2 years ago

@kumarvikram You can use alt="{{alt_image}}"

I will fix this in a next update but for now you can add this code.

kumarvikram commented 2 years ago

@eddiesigner Thanks but it is not working. Just rendering empty alt attribute.

eddiesigner commented 2 years ago

@kumarvikram Sorry, the correct attribute is alt="{{feature_image_alt}}"

eddiesigner commented 2 years ago

I will close this issue now since this was fixed in the latest version.