# frozen_string_literal: true class OEmbedSerializer < ActiveModel::Serializer INLINE_STYLES = { blockquote: 'max-width: 540px; min-width: 270px; background:#FCF8FF; border: 1px solid #C9C4DA; border-radius: 8px; overflow: hidden; margin: 0; padding: 0;', a: "color: #1C1A25; text-decoration: none; display: flex; align-items: center; justify-content: center; flex-direction: column; padding: 24px; font-size: 14px; line-height: 20px; letter-spacing: 0.25px; font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Oxygen, Ubuntu, Cantarell, 'Fira Sans', 'Droid Sans', 'Helvetica Neue', Roboto, sans-serif;", # rubocop:disable Layout/LineLength div0: 'margin-top: 16px; color: #787588;', div1: 'font-weight: 500;', }.freeze include RoutingHelper include ActionView::Helpers::TagHelper attributes :type, :version, :author_name, :author_url, :provider_name, :provider_url, :cache_age, :html, :width, :height def type 'rich' end def version '1.0' end def author_name object.account.display_name.presence || object.account.username end def author_url short_account_url(object.account) end def provider_name Rails.configuration.x.local_domain end def provider_url root_url end def cache_age 86_400 end def html <<~HTML.squish
HTML end def width instance_options[:width] end def height instance_options[:height] end endPost by @#{object.account.pretty_acct}@#{provider_name}View on Mastodon