Sha256: e50bb97c52bfd169b4b2259351bff787ef60672f3250846ebd16d7fdd55a204a

Contents?: true

Size: 523 Bytes

Versions: 7

Compression:

Stored size: 523 Bytes

Contents

module PictureTag
  module OutputFormats
    # Represents a bare <img> tag with a srcset attribute.
    # Used when <picture> is unnecessary.
    class Img < Basic
      def srcset
        @srcset ||= build_srcset(
          PictureTag.source_images.first, PictureTag.formats.first
        )
      end

      def base_markup
        img = build_base_img

        add_srcset(img, srcset)
        add_sizes(img, srcset)

        img.attributes << PictureTag.html_attributes['parent']

        img
      end
    end
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
jekyll_picture_tag-1.10.2 lib/jekyll_picture_tag/output_formats/img.rb
jekyll_picture_tag-1.10.1 lib/jekyll_picture_tag/output_formats/img.rb
jekyll_picture_tag-1.10.0 lib/jekyll_picture_tag/output_formats/img.rb
jekyll_picture_tag-1.9.0 lib/jekyll_picture_tag/output_formats/img.rb
jekyll_picture_tag-1.8.0 lib/jekyll_picture_tag/output_formats/img.rb
jekyll_picture_tag-1.7.1 lib/jekyll_picture_tag/output_formats/img.rb
jekyll_picture_tag-1.7.0 lib/jekyll_picture_tag/output_formats/img.rb