Sha256: a20427fea3e10c7fddc621c52691eb1df99f4b8dbc1a61d837cc162029108443

Contents?: true

Size: 509 Bytes

Versions: 9

Compression:

Stored size: 509 Bytes

Contents

# encoding: utf-8

require 'slim'

module Nanoc::Filters

  # @since 3.2.0
  class Slim < Nanoc::Filter

    # 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={})
      # Create context
      context = ::Nanoc::Context.new(assigns)

      ::Slim::Template.new { content }.render(context) { assigns[:content] }
    end

  end

end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
nanoc-3.4.0 lib/nanoc/filters/slim.rb
nanoc-3.3.7 lib/nanoc/filters/slim.rb
nanoc-3.3.6 lib/nanoc/filters/slim.rb
nanoc-3.3.5 lib/nanoc/filters/slim.rb
nanoc-3.3.4 lib/nanoc/filters/slim.rb
nanoc-3.3.3 lib/nanoc/filters/slim.rb
nanoc-3.3.2 lib/nanoc/filters/slim.rb
nanoc-3.3.1 lib/nanoc/filters/slim.rb
nanoc-3.3.0 lib/nanoc/filters/slim.rb