Sha256: 0d68a5cebddec1126ab32a88b61c78fc0e4b1ef895517a701c8681f605c176c2

Contents?: true

Size: 512 Bytes

Versions: 8

Compression:

Stored size: 512 Bytes

Contents

# encoding: utf-8

module Nanoc::Filters

  # @since 3.2.0
  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

8 entries across 8 versions & 1 rubygems

Version Path
nanoc-3.6.7 lib/nanoc/filters/mustache.rb
nanoc-3.6.6 lib/nanoc/filters/mustache.rb
nanoc-3.6.5 lib/nanoc/filters/mustache.rb
nanoc-3.6.4 lib/nanoc/filters/mustache.rb
nanoc-3.6.3 lib/nanoc/filters/mustache.rb
nanoc-3.6.2 lib/nanoc/filters/mustache.rb
nanoc-3.6.1 lib/nanoc/filters/mustache.rb
nanoc-3.6.0 lib/nanoc/filters/mustache.rb