Module: Jekyll::AssetsPlugin::Patches::ContextPatch

Defined in:
lib/jekyll/assets_plugin/patches/context_patch.rb

Instance Method Summary collapse

Instance Method Details

#asset_path(pathname, *args) ⇒ Object



16
17
18
19
20
21
22
23
# File 'lib/jekyll/assets_plugin/patches/context_patch.rb', line 16

def asset_path(pathname, *args)
  return "" if pathname.to_s.strip.empty?
  asset = resolve(pathname.to_s[/^[^#?]+/]).to_s
  jekyll_assets << asset
  (site.asset_path asset, *args) + (pathname.to_s[/[#?].+/] || "")
rescue Sprockets::FileNotFound
  raise Environment::AssetNotFound, pathname
end

#jekyll_assetsObject



12
13
14
# File 'lib/jekyll/assets_plugin/patches/context_patch.rb', line 12

def jekyll_assets
  @jekyll_assets ||= Set.new
end

#siteObject



8
9
10
# File 'lib/jekyll/assets_plugin/patches/context_patch.rb', line 8

def site
  self.class.instance_variable_get :@site
end