Sha256: 763d2e0800a1d335c1015e8d57480e1cb76cf091f3d6b625f5f3bd1efb83160f
Contents?: true
Size: 734 Bytes
Versions: 3
Compression:
Stored size: 734 Bytes
Contents
# encoding: utf-8 require 'handlebars' module Nanoc::Filters # @since 3.4.0 class Handlebars < Nanoc::Filter # Runs the content through # [Handlebars](http://handlebarsjs.com/) using # [Handlebars.rb](https://github.com/cowboyd/handlebars.rb). # This method takes no options. # # @param [String] content The content to filter # # @return [String] The filtered content def run(content, params={}) context = item.attributes.dup context[:item] = assigns[:item].attributes context[:layout] = assigns[:layout].attributes context[:config] = assigns[:config] context[:yield] = assigns[:content] ::Handlebars.compile(content).call(context) end end end
Version data entries
3 entries across 3 versions & 1 rubygems
Version | Path |
---|---|
nanoc-3.4.2 | lib/nanoc/filters/handlebars.rb |
nanoc-3.4.1 | lib/nanoc/filters/handlebars.rb |
nanoc-3.4.0 | lib/nanoc/filters/handlebars.rb |