0
0
Fork 0

Change design of link previews in web UI (#26136)

This commit is contained in:
Eugen Rochko 2023-07-24 13:47:28 +02:00 committed by GitHub
parent 4d01d1a1ee
commit 6b2952d1dd
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
7 changed files with 90 additions and 99 deletions

View file

@ -6,7 +6,7 @@ class REST::PreviewCardSerializer < ActiveModel::Serializer
attributes :url, :title, :description, :language, :type,
:author_name, :author_url, :provider_name,
:provider_url, :html, :width, :height,
:image, :embed_url, :blurhash
:image, :embed_url, :blurhash, :published_at
def image
object.image? ? full_asset_url(object.image.url(:original)) : nil
@ -15,4 +15,8 @@ class REST::PreviewCardSerializer < ActiveModel::Serializer
def html
Sanitize.fragment(object.html, Sanitize::Config::MASTODON_OEMBED)
end
def published_at
object.created_at
end
end