Sha256: b9c670a80d75d4b775d78a2faf4cf8e6127ee69780a69e6b819c4e47305ec146

Contents?: true

Size: 423 Bytes

Versions: 1

Compression:

Stored size: 423 Bytes

Contents

module Nanoc2::Filters
  class Haml < Nanoc2::Filter

    identifiers :haml

    def run(content)
      require 'haml'

      # Get options
      options = @obj_rep.attribute_named(:haml_options) || {}
      options[:filename] = filename

      # Create context
      context = ::Nanoc2::Extra::Context.new(assigns)

      # Get result
      ::Haml::Engine.new(content, options).render(context, assigns)
    end

  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
nanoc2-2.2.3 lib/nanoc2/filters/haml.rb