Sha256: e3daa77e850911d0757bb34aaf1b29813da6a5bcd3964a2a5a6f0e1eb88ae638
Contents?: true
Size: 1.15 KB
Versions: 6
Compression:
Stored size: 1.15 KB
Contents
# Frozen-string-literal: true # Copyright: 2012 - 2018 - MIT License # Encoding: utf-8 require "jekyll/assets" module Jekyll module Assets class Default class Component < Default content_types "text/html" internal! # -- 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 # -- def set_rel @args[:rel] = "import" end # -- def set_integrity return unless integrity? @args[:integrity] = @asset.integrity unless @args.key?(:crossorigin) @args[:crossorigin] = "anonymous" end end # -- def integrity? config[:integrity] && !@asset.is_a?(Url) && !@args.key?(:integrity) end end end end end # -- Jekyll::Assets::Hook.register :config, :before_merge do |c| c.deep_merge!({ defaults: { component: { integrity: Jekyll.production?, }, }, }) end
Version data entries
6 entries across 6 versions & 1 rubygems