Class: PictureTag::OutputFormats::Img
- Inherits:
-
Object
- Object
- PictureTag::OutputFormats::Img
- Includes:
- Basics
- Defined in:
- lib/jekyll-4-picture-tag/output_formats/img.rb
Overview
Represents a bare <img> tag with a srcset attribute. Used when <picture> is unnecessary.
Direct Known Subclasses
Instance Method Summary collapse
Methods included from Basics
Instance Method Details
#base_markup ⇒ Object
12 13 14 15 16 17 18 19 20 21 |
# File 'lib/jekyll-4-picture-tag/output_formats/img.rb', line 12 def base_markup img = build_base_img add_srcset(img, srcset) add_sizes(img, srcset) img.attributes << PictureTag.html_attributes['parent'] img end |
#srcset ⇒ Object
8 9 10 |
# File 'lib/jekyll-4-picture-tag/output_formats/img.rb', line 8 def srcset build_srcset(nil, PictureTag.preset['formats'].first) end |