Sha256: 560103ada8affbf4b3a32cc0d00c224d8db9dbcf566ca8986b642fa0b51005a0

Contents?: true

Size: 690 Bytes

Versions: 15

Compression:

Stored size: 690 Bytes

Contents

# Require gem
require 'haml'

module SafeTemplate
  def render(*)
    super.html_safe
  end
end

class Tilt::HamlTemplate
  include SafeTemplate
end

module Middleman
  module Renderers
    # Haml Renderer
    module Haml
      # Setup extension
      class << self
        # Once registered
        def registered(app)
          app.before_configuration do
            template_extensions haml: :html
          end

          # Add haml helpers to context
          app.send :include, ::Haml::Helpers

          # Setup haml helper paths
          app.ready do
            init_haml_helpers
          end
        end
        alias_method :included, :registered
      end
    end
  end
end

Version data entries

15 entries across 15 versions & 2 rubygems

Version Path
middleman-core-3.4.1 lib/middleman-core/renderers/haml.rb
middleman-core-3.4.0 lib/middleman-core/renderers/haml.rb
middleman-core-3.3.12 lib/middleman-core/renderers/haml.rb
middleman-core-3.3.11 lib/middleman-core/renderers/haml.rb
middleman-core-3.3.10 lib/middleman-core/renderers/haml.rb
middleman-core-3.3.9 lib/middleman-core/renderers/haml.rb
middleman-core-3.3.8 lib/middleman-core/renderers/haml.rb
middleman-core-3.3.7 lib/middleman-core/renderers/haml.rb
middleman-core-3.3.6 lib/middleman-core/renderers/haml.rb
middleman-core-3.3.5 lib/middleman-core/renderers/haml.rb
middleman-core-cj-3.3.6 lib/middleman-core/renderers/haml.rb
middleman-core-cj-3.3.5 lib/middleman-core/renderers/haml.rb
middleman-core-cj-3.3.4 lib/middleman-core/renderers/haml.rb
middleman-core-3.3.4 lib/middleman-core/renderers/haml.rb
middleman-core-3.3.3 lib/middleman-core/renderers/haml.rb