Sha256: 1e288d1cb8cfd6c3667082010aaa75603946d42461810d72b8b2edea7d5fefe3

Contents?: true

Size: 510 Bytes

Versions: 39

Compression:

Stored size: 510 Bytes

Contents

module Nanoc::Filters
  # @since 3.2.0
  #
  # @api private
  class Mustache < Nanoc::Filter
    requires 'mustache'

    # Runs the content through
    # [Mustache](http://github.com/defunkt/mustache). This method takes no
    # options.
    #
    # @param [String] content The content to filter
    #
    # @return [String] The filtered content
    def run(content, _params = {})
      context = item.attributes.merge({ yield: assigns[:content] })
      ::Mustache.render(content, context)
    end
  end
end

Version data entries

39 entries across 39 versions & 1 rubygems

Version Path
nanoc-4.2.0b1 lib/nanoc/filters/mustache.rb
nanoc-4.1.5 lib/nanoc/filters/mustache.rb
nanoc-4.1.4 lib/nanoc/filters/mustache.rb
nanoc-4.1.3 lib/nanoc/filters/mustache.rb
nanoc-4.1.2 lib/nanoc/filters/mustache.rb
nanoc-4.1.1 lib/nanoc/filters/mustache.rb
nanoc-4.1.0 lib/nanoc/filters/mustache.rb
nanoc-4.1.0rc2 lib/nanoc/filters/mustache.rb
nanoc-4.1.0rc1 lib/nanoc/filters/mustache.rb
nanoc-4.1.0b1 lib/nanoc/filters/mustache.rb
nanoc-4.1.0a1 lib/nanoc/filters/mustache.rb
nanoc-4.0.2 lib/nanoc/filters/mustache.rb
nanoc-4.0.1 lib/nanoc/filters/mustache.rb
nanoc-4.0.0 lib/nanoc/filters/mustache.rb
nanoc-4.0.0rc3 lib/nanoc/filters/mustache.rb
nanoc-4.0.0rc2 lib/nanoc/filters/mustache.rb
nanoc-4.0.0rc1 lib/nanoc/filters/mustache.rb
nanoc-4.0.0b4 lib/nanoc/filters/mustache.rb
nanoc-4.0.0b3 lib/nanoc/filters/mustache.rb