Sha256: 2fa4fabbd212c6dd7e8ccfdcadea10e528495621df000141207519e0efc8df4b

Contents?: true

Size: 488 Bytes

Versions: 1

Compression:

Stored size: 488 Bytes

Contents

# encoding: utf-8

require "ace/filters"
require "template-inheritance"

layouts = File.join(Dir.pwd, "layouts")
unless TemplateInheritance::Template.paths.include?(layouts)
  TemplateInheritance::Template.paths.unshift(layouts)
end

module Ace
  class LayoutFilter < Filter
    def initialize(options)
      @path = options[:layout]
    end

    def call(item, content)
      template = TemplateInheritance::Template.new(@path)
      return template.render(item: item)
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
ace-0.1 lib/ace/filters/layout.rb