Module: Jekyll::Assets::Context

Defined in:
lib/jekyll/assets/context.rb

Instance Method Summary collapse

Instance Method Details

#asset_path(path, _ = {}) ⇒ String

Note:

this SASS helper fully supports proxy arguments.

– Allows you to get an asset by it’s path. –

Parameters:

  • opts (Hash)

    this is unused but necessary.

  • path (String)

    the path.

Returns:

  • (String)

    the path.



19
20
21
22
23
24
# File 'lib/jekyll/assets/context.rb', line 19

def asset_path(path, _ = {})
  ctx1 = Liquid::ParseContext.new
  ctx2 = Liquid::Context.new({}, {}, site: environment.jekyll)
  Jekyll::Assets::Tag.new("img", "#{path} @path", ctx1)
    .render(ctx2)
end