Module: Middleman::Renderers::Slim

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

Overview

Slim renderer

Class Method Summary collapse

Class Method Details

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

Once registered



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

def registered(app)
  app.before_configuration do
    template_extensions :slim => :html
  end

  # Setup Slim options to work with partials
  ::Slim::Engine.set_default_options(
    :buffer    => '@_out_buf',
    :generator => ::Temple::Generators::StringBuffer
  )
  
  app.after_configuration do
    context_hack = {
      :context => self
    }
    %w(sass scss markdown).each do |engine|
      ::Slim::EmbeddedEngine.default_options[engine.to_sym] = context_hack
    end
  end
end