module Jekyll::Assets::Helpers

Public Instance Methods

asset_path(path, opts = {}) click to toggle source

– @param [String] path the path you wish to resolve. Find the path to the asset. –

# File lib/jekyll/assets/helpers.rb, line 13
def asset_path(path, opts = {})
  return path if Pathname.new(path).absolute?
  asset = manifest.find(path).first

  if asset
    manifest.add(asset)
    parent.prefix_path(
      parent.digest?? asset.digest_path : asset.logical_path
    )
  else
    path
  end
end
asset_url(path, opts = {}) click to toggle source

– @param [String] path the path you wish to resolve. Pull the asset path and wrap it in url(). –

# File lib/jekyll/assets/helpers.rb, line 31
def asset_url(path, opts = {})
  "url(#{asset_path(
    path, opts
  )})"
end
parent() click to toggle source

– Get access to the actual asset environment. @return [Jekyll::Assets::Env] –

# File lib/jekyll/assets/helpers.rb, line 41
def parent
  environment.is_a?(Cached) ? environment.parent : environment
end