Sha256: bad2ddfb666b39f134644dbea229d584701f1d3923a6b7893e2cf4e30cbafe9e

Contents?: true

Size: 508 Bytes

Versions: 2

Compression:

Stored size: 508 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

2 entries across 2 versions & 1 rubygems

Version Path
nanoc-3.8.0 lib/nanoc/filters/mustache.rb
nanoc-3.7.5 lib/nanoc/filters/mustache.rb