Module: Middleman::Renderers::Liquid

Defined in:
lib/middleman-core/renderers/liquid.rb

Overview

Liquid Renderer

Class Method Summary collapse

Class Method Details

.registered(app) ⇒ Object Also known as: included

Once registerd



14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
# File 'lib/middleman-core/renderers/liquid.rb', line 14

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. %r{\.liquid$} do |path|
      { :locals => { :data => data.to_h } }
    end
  end
end