Sha256: aff00fbef0bc88631e4cdc874e289ca0335250fb3b0c09e599bc3c1f65ef3c9e

Contents?: true

Size: 507 Bytes

Versions: 7

Compression:

Stored size: 507 Bytes

Contents

# encoding: utf-8

require 'mustache'

module Nanoc::Filters

  # @since 3.2.0
  class Mustache < Nanoc::Filter

    # 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

7 entries across 7 versions & 1 rubygems

Version Path
nanoc-3.5.0 lib/nanoc/filters/mustache.rb
nanoc-3.5.0b2 lib/nanoc/filters/mustache.rb
nanoc-3.5.0b1 lib/nanoc/filters/mustache.rb
nanoc-3.4.3 lib/nanoc/filters/mustache.rb
nanoc-3.4.2 lib/nanoc/filters/mustache.rb
nanoc-3.4.1 lib/nanoc/filters/mustache.rb
nanoc-3.4.0 lib/nanoc/filters/mustache.rb