Class: Jekyll::Prefetch

Inherits:
Liquid::Block
  • Object
show all
Includes:
AssetPages::Jekyll::LiquidHelper
Defined in:
lib/asset_pages/jekyll/plugins/prefetch.rb

Constant Summary collapse

AssetPathPattern =
Regexp.new("#{Liquid::QuotedFragment}+")

Constants included from AssetPages::Jekyll::LiquidHelper

AssetPages::Jekyll::LiquidHelper::Root

Instance Method Summary collapse

Methods included from AssetPages::Jekyll::LiquidHelper

included

Instance Method Details

#render(context) ⇒ Object



27
28
29
30
31
32
33
34
35
36
37
38
39
# File 'lib/asset_pages/jekyll/plugins/prefetch.rb', line 27

def render(context)
  @context = context

  super.split("\n", -1).each do |line|
    options, line = AssetTag.parse_options(line)

    line.scan(AssetPathPattern) do |path|
      asset_path(path, options.merge(debug: false))
    end
  end

  ""
end