Sha256: c9af6f8a8228117b75ad5b1f60c2ab1c12140edd7eb382d3eee35154e31653c7
Contents?: true
Size: 704 Bytes
Versions: 20
Compression:
Stored size: 704 Bytes
Contents
module Nanoc::Filters # @api private class Slim < Nanoc::Filter identifier :slim requires 'slim' # Runs the content through [Slim](http://slim-lang.com/). # This method takes no options. # # @param [String] content The content to filter # # @return [String] The filtered content def run(content, params = {}) params = { disable_capture: true, # Capture managed by Nanoc buffer: '_erbout', # Force slim to output to the buffer used by Nanoc }.merge params # Create context context = ::Nanoc::Int::Context.new(assigns) ::Slim::Template.new(params) { content }.render(context) { assigns[:content] } end end end
Version data entries
20 entries across 20 versions & 1 rubygems