Sha256: 3fab25b8848d6684158896994878389a5171048b18ea048b4e84db35060c11d0
Contents?: true
Size: 746 Bytes
Versions: 49
Compression:
Stored size: 746 Bytes
Contents
# frozen_string_literal: true 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::Core::Context.new(assigns) ::Slim::Template.new(filename, params) { content }.render(context) { assigns[:content] } end end end
Version data entries
49 entries across 49 versions & 1 rubygems