Sha256: bf135c60e740f0ebf49dc240b0c3a3fae04c8094c160c7029014ad8d4dd3d068

Contents?: true

Size: 1.08 KB

Versions: 39

Compression:

Stored size: 1.08 KB

Contents

module Pugin
  module ViewHelpers
    def navigation_link(route_symbol:, route_args:, letter:)
      url = send(route_symbol, *route_args, letter) unless route_args.empty?
      url = send(route_symbol, letter) unless url
      return link_to(letter, url, data: { 'atoz-see': 'true' })
    end

    def opengraph_image_standards
      { width: '400', height: '400', twitter_card: 'summary', url: "#{STATIC_ASSET_PUBLIC_LOCATION_URL}/opengraph-oblong.png" }
    end

    def opengraph_image
      image_hash = if @image && @image.respond_to?('graph_id')
                     {url: "#{ENV['IMAGE_SERVICE_URL']}/#{@image.graph_id}.jpeg?crop=CU_1:1&width=400&quality=100"}
                   elsif @person && @person.respond_to?('image_id') && @person.image_id != 'placeholder' && !@image
                     {url: "#{ENV['IMAGE_SERVICE_URL']}/#{@person.image_id}.jpeg?crop=CU_1:1&width=400&quality=100"}
                   else
                     {width: '1200', height: '630', twitter_card: 'summary_large_image' }
                   end

      opengraph_image_standards.merge(image_hash)
    end
  end
end

Version data entries

39 entries across 39 versions & 1 rubygems

Version Path
pugin-1.10.10 lib/pugin/view_helpers.rb
pugin-1.10.9 lib/pugin/view_helpers.rb
pugin-1.10.8 lib/pugin/view_helpers.rb
pugin-1.10.7 lib/pugin/view_helpers.rb
pugin-1.10.6 lib/pugin/view_helpers.rb
pugin-1.10.5 lib/pugin/view_helpers.rb
pugin-1.10.4 lib/pugin/view_helpers.rb
pugin-1.10.3 lib/pugin/view_helpers.rb
pugin-1.10.2 lib/pugin/view_helpers.rb
pugin-1.10.1 lib/pugin/view_helpers.rb
pugin-1.10.0 lib/pugin/view_helpers.rb
pugin-1.9.7 lib/pugin/view_helpers.rb
pugin-1.9.6 lib/pugin/view_helpers.rb
pugin-1.9.5 lib/pugin/view_helpers.rb
pugin-1.9.4 lib/pugin/view_helpers.rb
pugin-1.9.3 lib/pugin/view_helpers.rb
pugin-1.9.2 lib/pugin/view_helpers.rb
pugin-1.9.1 lib/pugin/view_helpers.rb
pugin-1.9.0 lib/pugin/view_helpers.rb
pugin-1.8.9 lib/pugin/view_helpers.rb