Sha256: 5b6ec00cb9f8fe77e80b911fa34794c15987d9c54922caceb83980ffc8ed538e

Contents?: true

Size: 792 Bytes

Versions: 5

Compression:

Stored size: 792 Bytes

Contents

# Require Gem
require "liquid"

module Middleman
  module Renderers

    # Liquid Renderer
    module Liquid
  
      # Setup extension
      class << self
    
        # Once registerd
        def registered(app)
          app.before_configuration do
            template_extensions :liquid => :html
          end
    
          # After config, setup liquid partial paths
          app.after_configuration do
            ::Liquid::Template.file_system = ::Liquid::LocalFileSystem.new(source_dir)
        
            # Convert data object into a hash for liquid
            sitemap.provides_metadata %r{\.liquid$} do |path|
              { :locals => { :data => data.to_h } }
            end
          end
        end
    
        alias :included :registered
      end
    end
    
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
middleman-core-3.0.0 lib/middleman-core/renderers/liquid.rb
middleman-core-3.0.0.rc.4 lib/middleman-core/renderers/liquid.rb
middleman-core-3.0.0.rc.3 lib/middleman-core/renderers/liquid.rb
middleman-core-3.0.0.rc.2 lib/middleman-core/renderers/liquid.rb
middleman-core-3.0.0.rc.1 lib/middleman-core/renderers/liquid.rb