Add alt text for preview card thumbnails (#26184)
This commit is contained in:
parent
ca19ea30d4
commit
8da99ffb0d
9 changed files with 258 additions and 100 deletions
|
@ -113,6 +113,7 @@ class LinkDetailsExtractor
|
|||
title: title || '',
|
||||
description: description || '',
|
||||
image_remote_url: image,
|
||||
image_description: image_alt || '',
|
||||
type: type,
|
||||
link_type: link_type,
|
||||
width: width || 0,
|
||||
|
@ -168,6 +169,10 @@ class LinkDetailsExtractor
|
|||
valid_url_or_nil(opengraph_tag('og:image'))
|
||||
end
|
||||
|
||||
def image_alt
|
||||
opengraph_tag('og:image:alt')
|
||||
end
|
||||
|
||||
def canonical_url
|
||||
valid_url_or_nil(link_tag('canonical') || opengraph_tag('og:url'), same_origin_only: true) || @original_url.to_s
|
||||
end
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue