Sha256: d683335a7ffc7f6869c9e4392607e3b21079c43e1eaa8b941c1eca8bd9421172

Contents?: true

Size: 1.97 KB

Versions: 12

Compression:

Stored size: 1.97 KB

Contents

module Pageflow
  class Configuration
    module Defaults
      PAPERCLIP_FILESYSTEM_DEFAULT_OPTIONS = {
        storage: :filesystem,
        path: ':pageflow_filesystem_root/:class/:attachment/:id_partition/:style/:filename',
        url: 'not_uploaded_yet',
        validate_media_type: false
      }.freeze

      PAPERCLIP_S3_DEFAULT_OPTIONS = {
        storage: :s3,
        s3_headers: {'Cache-Control' => 'public, max-age=31536000'},

        url: ':s3_alias_url',
        path: ':pageflow_s3_root/:class_basename/:attachment/' \
          ':id_partition/:pageflow_attachments_version:style/:filename',

        validate_media_type: false,

        # Paperclip deletes and reuploads the original on
        # reprocess. Sometimes S3 seems to change the order of commands
        # causing the image to be deleted. This is fixed on paperclip
        # master, but for us not deleting old files is good enough. They
        # might be in the CDN anyway.
        keep_old_files: true
      }.freeze

      THUMBNAIL_STYLES = {
        thumbnail: {
          geometry: '100x100#',
          format: :JPG
        },
        thumbnail_large: {
          geometry: '560x315#',
          format: :JPG
        },

        navigation_thumbnail_small: {
          geometry: '85x47#',
          format: :JPG
        },
        navigation_thumbnail_large: {
          geometry: '170x95#',
          format: :JPG
        },
        thumbnail_overview_desktop: {
          geometry: '230x72#',
          format: :JPG
        },
        thumbnail_overview_mobile: {
          geometry: '200x112#',
          format: :JPG
        },

        link_thumbnail: {
          geometry: '192x108#',
          format: :JPG
        },
        link_thumbnail_large: {
          geometry: '394x226#',
          format: :JPG
        }
      }.freeze

      CSS_RENDERED_THUMBNAIL_STYLES = [
        :thumbnail_large,
        :navigation_thumbnail_large,
        :link_thumbnail,
        :link_thumbnail_large
      ].freeze
    end
  end
end

Version data entries

12 entries across 12 versions & 1 rubygems

Version Path
pageflow-13.6.0 lib/pageflow/configuration/defaults.rb
pageflow-13.5.0 lib/pageflow/configuration/defaults.rb
pageflow-13.4.0 lib/pageflow/configuration/defaults.rb
pageflow-13.3.0 lib/pageflow/configuration/defaults.rb
pageflow-13.2.0 lib/pageflow/configuration/defaults.rb
pageflow-13.1.0 lib/pageflow/configuration/defaults.rb
pageflow-13.0.0 lib/pageflow/configuration/defaults.rb
pageflow-13.0.0.rc1 lib/pageflow/configuration/defaults.rb
pageflow-13.0.0.beta7 lib/pageflow/configuration/defaults.rb
pageflow-13.0.0.beta6 lib/pageflow/configuration/defaults.rb
pageflow-13.0.0.beta5 lib/pageflow/configuration/defaults.rb
pageflow-13.0.0.beta4 lib/pageflow/configuration/defaults.rb