Sha256: 14c31219307bfa8fd7ce8ae775bb5bd12fd1414c2e0031a1deebceeca44d8b8c
Contents?: true
Size: 720 Bytes
Versions: 9
Compression:
Stored size: 720 Bytes
Contents
# encoding: utf-8 module Nanoc::Filters # @since 3.2.0 class Slim < Nanoc::Filter 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::Context.new(assigns) ::Slim::Template.new(params) { content }.render(context) { assigns[:content] } end end end
Version data entries
9 entries across 9 versions & 1 rubygems