Sha256: ad81c21baf8647d15afb05393959ec02c07cca70b2008c039e0f67f41b2dfab8

Contents?: true

Size: 588 Bytes

Versions: 7

Compression:

Stored size: 588 Bytes

Contents

module Locomotive
  module Wagon
    module Liquid
      module Tags
        class Extends < ::Liquid::Extends

          def parse_parent_template
            mounting_point = @context[:mounting_point]

            page = if @template_name == 'parent'
              @context[:page].parent
            else
              mounting_point.pages[@template_name]
            end

            ::Liquid::Template.parse(page.source, { mounting_point: mounting_point, page: page })
          end

        end

        ::Liquid::Template.register_tag('extends', Extends)
      end
    end
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
locomotivecms_wagon-1.2.2 lib/locomotive/wagon/liquid/tags/extends.rb
locomotivecms_wagon-1.2.1 lib/locomotive/wagon/liquid/tags/extends.rb
locomotivecms_wagon-1.2.0 lib/locomotive/wagon/liquid/tags/extends.rb
locomotivecms_wagon-1.1.0 lib/locomotive/wagon/liquid/tags/extends.rb
locomotivecms_wagon-1.0.2 lib/locomotive/wagon/liquid/tags/extends.rb
locomotivecms_wagon-1.0.1 lib/locomotive/wagon/liquid/tags/extends.rb
locomotivecms_wagon-1.0.0 lib/locomotive/wagon/liquid/tags/extends.rb