Class: Jekyll::Assets::Plugins::Liquid

Inherits:
Object
  • Object
show all
Defined in:
lib/jekyll/assets/plugins/liquid.rb

Constant Summary collapse

TYPES =
{
  "text/liquid+sass" => %w(.sass.liquid .liquid.sass),
  "application/liquid+javascript" =>  %w(.liquid.js .js.liquid),
  "application/liquid+ecmascript-6" => %w(.liquid.es6 .es6.liquid),
  "text/liquid+coffeescript" => %w(.liquid.coffee .coffee.liquid),
  "text/liquid+scss" => %w(.liquid.scss .scss.liquid),
  "text/liquid+css" => %w(.liquid.css .css.liquid),
}.freeze

Class Method Summary collapse

Class Method Details

.call(ctx) ⇒ Object



23
24
25
26
27
28
29
30
31
32
33
34
# File 'lib/jekyll/assets/plugins/liquid.rb', line 23

def self.call(ctx)
  env = ctx[:environment]
  registers = { site: env.jekyll }
  environment = env.jekyll.to_liquid.merge(jekyll: {
    "version" => Jekyll::VERSION, "environment" => Jekyll.env
  })

  bctx = ::Liquid::Context.new(environment, {}, registers)
  ctx[:data] = env.parse_liquid(ctx[:data], {
    ctx: bctx,
  })
end