Class: Jekyll::Assets::Default::Component
- Inherits:
-
Jekyll::Assets::Default
- Object
- Extensible
- Jekyll::Assets::Default
- Jekyll::Assets::Default::Component
- Defined in:
- lib/jekyll/assets/plugins/html/defaults/component.rb
Instance Attribute Summary
Attributes inherited from Extensible
#args, #asset, #ctx, #env, #jekyll
Instance Method Summary collapse
Methods inherited from Jekyll::Assets::Default
#config, get, #run, set, set_static, static
Methods inherited from Extensible
for?, for_args?, for_type?, inherited, #initialize, internal!, internal?, requirements
Constructor Details
This class inherits a constructor from Jekyll::Assets::Extensible
Instance Method Details
#integrity? ⇒ Boolean
–
37 38 39 40 |
# File 'lib/jekyll/assets/plugins/html/defaults/component.rb', line 37 def integrity? config[:integrity] && !@asset.is_a?(Url) && !@args.key?(:integrity) end |
#set_href ⇒ Object
–
15 16 17 18 19 20 |
# File 'lib/jekyll/assets/plugins/html/defaults/component.rb', line 15 def set_href dpath = @asset.digest_path return @args[:href] = @asset.url if @asset.is_a?(Url) return @args[:href] = @env.prefix_url(dpath) unless @args[:inline] @args[:href] = @asset.data_uri end |
#set_integrity ⇒ Object
–
28 29 30 31 32 33 34 |
# File 'lib/jekyll/assets/plugins/html/defaults/component.rb', line 28 def set_integrity return unless integrity? @args[:integrity] = @asset.integrity unless @args.key?(:crossorigin) @args[:crossorigin] = "anonymous" end end |
#set_rel ⇒ Object
–
23 24 25 |
# File 'lib/jekyll/assets/plugins/html/defaults/component.rb', line 23 def set_rel @args[:rel] = "import" end |