Sha256: 3e5fa024583c2df5d85b49f74d2aa1da580e893fda5cc24b1d65ef19931587a6

Contents?: true

Size: 880 Bytes

Versions: 35

Compression:

Stored size: 880 Bytes

Contents

module Middleman::Renderers::Liquid
  class << self
    def registered(app)
      # Liquid is not included in the default gems,
      # but we'll support it if necessary.
      begin
        require "liquid"
        
        app.after_configuration do
          full_path = app.views
          full_path = File.join(app.root, app.views) unless app.views.include?(app.root)
          
          Liquid::Template.file_system = Liquid::LocalFileSystem.new(full_path)
            
          app.before_processing(:liquid) do |result|
            if result && result[1] == :liquid
              request['custom_locals'] ||= {}
              request['custom_locals'][:data] = data.to_h
              # request['custom_locals'].merge(data.to_h)
            end

            true
          end
        end
      rescue LoadError
      end
    end
    alias :included :registered
  end
end

Version data entries

35 entries across 35 versions & 1 rubygems

Version Path
middleman-2.0.16.1-x86-mingw32 lib/middleman/renderers/liquid.rb
middleman-2.0.16.1 lib/middleman/renderers/liquid.rb
middleman-2.0.16-x86-mingw32 lib/middleman/renderers/liquid.rb
middleman-2.0.16 lib/middleman/renderers/liquid.rb
middleman-2.0.15.4-x86-mingw32 lib/middleman/renderers/liquid.rb
middleman-2.0.15.4 lib/middleman/renderers/liquid.rb
middleman-2.0.15.3-x86-mingw32 lib/middleman/renderers/liquid.rb
middleman-2.0.15.3 lib/middleman/renderers/liquid.rb
middleman-2.0.15.2-x86-mingw32 lib/middleman/renderers/liquid.rb
middleman-2.0.15.2 lib/middleman/renderers/liquid.rb
middleman-2.0.15.1-x86-mingw32 lib/middleman/renderers/liquid.rb
middleman-2.0.15.1 lib/middleman/renderers/liquid.rb
middleman-2.0.15-x86-mingw32 lib/middleman/renderers/liquid.rb
middleman-2.0.15 lib/middleman/renderers/liquid.rb
middleman-2.0.14-x86-mingw32 lib/middleman/renderers/liquid.rb
middleman-2.0.14 lib/middleman/renderers/liquid.rb
middleman-2.0.14.pre2-x86-mingw32 lib/middleman/renderers/liquid.rb
middleman-2.0.14.pre2 lib/middleman/renderers/liquid.rb
middleman-2.0.13.2-x86-mingw32 lib/middleman/renderers/liquid.rb
middleman-2.0.14.pre-x86-mingw32 lib/middleman/renderers/liquid.rb