Sha256: e2ff2c1af095df36ef66db94dddf19f7e15ae4ce2925dd5f33db873e8d767e63

Contents?: true

Size: 1.02 KB

Versions: 15

Compression:

Stored size: 1.02 KB

Contents

# Load gem
require "slim"

module Middleman
  module Renderers

    # Slim renderer
    module Slim

      # Setup extension
      class << self

        # Once registered
        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',
            :use_html_safe => true,
            :generator => ::Temple::Generators::RailsOutputBuffer,
            :disable_escape => true
          )
          
          app.after_configuration do
            context_hack = {
              :context => self
            }

            slim_embedded = defined?(::Slim::Embedded) ? ::Slim::Embedded : ::Slim::EmbeddedEngine

            %w(sass scss markdown).each do |engine|
              slim_embedded.default_options[engine.to_sym] = context_hack
            end
          end
        end

        alias :included :registered
      end
    end
  end
end

Version data entries

15 entries across 15 versions & 1 rubygems

Version Path
middleman-core-3.2.1 lib/middleman-core/renderers/slim.rb
middleman-core-3.2.0 lib/middleman-core/renderers/slim.rb
middleman-core-3.1.6 lib/middleman-core/renderers/slim.rb
middleman-core-3.1.5 lib/middleman-core/renderers/slim.rb
middleman-core-3.1.4 lib/middleman-core/renderers/slim.rb
middleman-core-3.1.3 lib/middleman-core/renderers/slim.rb
middleman-core-3.1.2 lib/middleman-core/renderers/slim.rb
middleman-core-3.1.1 lib/middleman-core/renderers/slim.rb
middleman-core-3.1.0 lib/middleman-core/renderers/slim.rb
middleman-core-3.1.0.rc.4 lib/middleman-core/renderers/slim.rb
middleman-core-3.1.0.rc.3 lib/middleman-core/renderers/slim.rb
middleman-core-3.1.0.rc.2 lib/middleman-core/renderers/slim.rb
middleman-core-3.1.0.rc.1 lib/middleman-core/renderers/slim.rb
middleman-core-3.1.0.beta.3 lib/middleman-core/renderers/slim.rb
middleman-core-3.1.0.beta.2 lib/middleman-core/renderers/slim.rb