Sha256: 8736081a3c9e72c69db26e038b4758e6baf3e6a797e5d492a86194ea33cbae19
Contents?: true
Size: 859 Bytes
Versions: 18
Compression:
Stored size: 859 Bytes
Contents
# frozen_string_literal: true require 'dato/utils/meta_tags/base' module Dato module Utils module MetaTags class Image < Base def build return unless image [ og_tag('og:image', image.url), card_tag('twitter:image', image.url) ] end def image @image ||= seo_field_with_fallback(:image, item_image) end def item_image item && item.fields .select { |field| field.field_type == 'image' } .map { |field| item.send(field.api_key) } .compact .find do |image| image.width && image.height && image.width >= 200 && image.height >= 200 end end end end end end
Version data entries
18 entries across 18 versions & 1 rubygems