Class: Jekyll::Assets::Default::CSS

Inherits:
Jekyll::Assets::Default show all
Defined in:
lib/jekyll/assets/plugins/html/defaults/css.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

Returns:

  • (Boolean)


33
34
35
36
# File 'lib/jekyll/assets/plugins/html/defaults/css.rb', line 33

def integrity?
  config[:integrity] && !@asset.is_a?(Url) &&
    !@args.key?(:integrity)
end

#set_hrefObject



16
17
18
19
20
21
# File 'lib/jekyll/assets/plugins/html/defaults/css.rb', line 16

def set_href
  return if @args[:inline]
  return @args[:href] = @asset.url if @asset.is_a?(Url)
  @args[:href] = @env.prefix_url(@asset
    .digest_path)
end

#set_integrityObject



24
25
26
27
28
29
30
# File 'lib/jekyll/assets/plugins/html/defaults/css.rb', line 24

def set_integrity
  return unless integrity?
  @args[:integrity] = @asset.integrity
  if !@args.key?(:crossorigin) && @args[:integrity]
    @args[:crossorigin] = "anonymous"
  end
end