Sha256: 4a38e20659123efda3683f42752185ccda0dc7f6001acfce79c779848967c45d

Contents?: true

Size: 1.16 KB

Versions: 7

Compression:

Stored size: 1.16 KB

Contents

module PictureTag
  module Instructions
    # PictureTag configuration
    class Config < Instruction
      def source
        PictureTag::Parsers::Configuration.new
      end
    end

    # Tag parameters
    class Params < Instruction
      def source
        PictureTag::Parsers::TagParser.new PictureTag.raw_params
      end
    end

    # Currently selected preset
    class Preset < Instruction
      def source
        PictureTag::Parsers::Preset.new PictureTag.params.preset_name
      end
    end

    # Handles non-image arguments to liquid tag and preset.
    class HtmlAttributes < Instruction
      def source
        PictureTag::Parsers::HTMLAttributeSet.new PictureTag.params.leftovers
      end
    end

    # TODO: rename to MediaQueries
    # Returns user-defined media queries.
    class MediaPresets < Instruction
      def source
        STOCK_MEDIA_QUERIES.merge(
          PictureTag.site.data.dig('picture', 'media_queries') || {}
        )
      end
    end

    # Main job is to determine which backend should handle which image formats.
    class Backend < Instruction
      def source
        PictureTag::Parsers::ImageBackend.new
      end
    end
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
jekyll_picture_tag-2.1.2 lib/jekyll_picture_tag/instructions/children/parsers.rb
jekyll_picture_tag-2.1.1 lib/jekyll_picture_tag/instructions/children/parsers.rb
jekyll_picture_tag-2.1.0 lib/jekyll_picture_tag/instructions/children/parsers.rb
jekyll_picture_tag-2.0.4 lib/jekyll_picture_tag/instructions/children/parsers.rb
jekyll_picture_tag-2.0.3 lib/jekyll_picture_tag/instructions/children/parsers.rb
jekyll_picture_tag-2.0.2 lib/jekyll_picture_tag/instructions/children/parsers.rb
jekyll_picture_tag-2.0.1 lib/jekyll_picture_tag/instructions/children/parsers.rb