0
Fork 0
mirror of https://github.com/TryGhost/Ghost.git synced 2025-01-20 22:42:53 -05:00

🐛 Fixed missing alt on AMP images (#14453)

closes: #14440 

- use best available values to provide alt tags on images in amp.hbs
- this prevents certain tools from reporting errors/warnings with our amp pages
This commit is contained in:
Ghassan Maslamani 2022-04-28 13:33:22 +03:00 committed by GitHub
parent 923477eb6f
commit aacb30e35e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -987,7 +987,7 @@
<header class="page-header">
<a href="{{@site.url}}">
{{#if @site.icon}}
<amp-img class="site-icon" src="{{img_url @site.icon absolute="true"}}" width="50" height="50" layout="fixed"></amp-img>
<amp-img class="site-icon" src="{{img_url @site.icon absolute="true"}}" width="50" height="50" layout="fixed" alt="{{@site.title}}"></amp-img>
{{else}}
{{@site.title}}
{{/if}}
@ -1006,7 +1006,9 @@
</header>
{{#if feature_image}}
<figure class="post-image">
<amp-img src="{{img_url feature_image absolute="true"}}" width="600" height="340" layout="responsive"></amp-img>
<amp-img src="{{img_url feature_image absolute="true"}}" width="600" height="340" layout="responsive"
alt="{{#if feature_image_alt}}{{feature_image_alt}}{{else}}{{title}}{{/if}}"
></amp-img>
</figure>
{{/if}}
<section class="post-content">
@ -1020,7 +1022,7 @@
{{/post}}
<footer class="page-footer">
{{#if @site.icon}}
<amp-img class="site-icon" src="{{img_url @site.icon absolute="true"}}" width="50" height="50" layout="fixed"></amp-img>
<amp-img class="site-icon" src="{{img_url @site.icon absolute="true"}}" width="50" height="50" layout="fixed" alt="{{@site.title}}"></amp-img>
{{/if}}
<h3>{{@site.title}}</h3>
{{#if @site.description}}