_og.html.haml 786 B

1234567891011121314
  1. - thumbnail = instance_presenter.thumbnail
  2. - description ||= instance_presenter.description.presence || strip_tags(t('about.about_mastodon_html'))
  3. %meta{ name: 'description', content: description }/
  4. = opengraph 'og:site_name', t('about.hosted_on', domain: site_hostname)
  5. = opengraph 'og:url', url_for(only_path: false)
  6. = opengraph 'og:type', 'website'
  7. = opengraph 'og:title', instance_presenter.title
  8. = opengraph 'og:description', description
  9. = opengraph 'og:image', full_asset_url(thumbnail&.file&.url(:'@1x') || asset_pack_path('media/images/preview.png', protocol: :request))
  10. = opengraph 'og:image:width', thumbnail ? thumbnail.meta['width'] : '1200'
  11. = opengraph 'og:image:height', thumbnail ? thumbnail.meta['height'] : '630'
  12. = opengraph 'twitter:card', 'summary_large_image'