]> cat aescling's git repositories - mastodon.git/commitdiff
add og:image:alt for media attachments in embeds (#10779)
authorBen Lubar <ben.lubar@gmail.com>
Sat, 18 May 2019 18:57:45 +0000 (13:57 -0500)
committerEugen Rochko <eugen@zeonfederated.com>
Sat, 18 May 2019 18:57:45 +0000 (20:57 +0200)
app/views/stream_entries/_og_image.html.haml

index e1b977da369f2f8be09399e9a4d6ff89ec7e7b86..67f9274b6ffb016cdd7f5c956f0e7407300e2673 100644 (file)
@@ -7,6 +7,8 @@
       - unless media.file.meta.nil?
         = opengraph 'og:image:width', media.file.meta.dig('original', 'width')
         = opengraph 'og:image:height', media.file.meta.dig('original', 'height')
+      - if media.description.present?
+        = opengraph 'og:image:alt', media.description
     - elsif media.video? || media.gifv?
       - player_card = true
       = opengraph 'og:image', full_asset_url(media.file.url(:small))