Sha256: 42db88bc9cd00a9606e5a3eeb33f80a157bf1c2167d98809f07d06eb69f48bb1

Contents?: true

Size: 409 Bytes

Versions: 1

Compression:

Stored size: 409 Bytes

Contents

module Nanoc::Filters
  class Haml < Nanoc::Filter

    identifiers :haml
    extensions  '.haml'

    def run(content)
      require 'haml'

      # Get options
      options = @page_rep.attribute_named(:haml_options) || {}

      # Create context
      context = ::Nanoc::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
nanoc-2.1.2 lib/nanoc/filters/haml.rb