Class: IncludeTag

Inherits:
LiquidumTag
  • Object
show all
Defined in:
lib/scribo/liquid/tags/include_tag.rb

Overview

Include other published content

Basic usage:

{%include 'navigation'}

Advanced usage:

{%include 'navigation' title:"Menu"}

This allows you pass variables to the included content, which will only available there

Instance Method Summary collapse

Instance Method Details

#render(context) ⇒ Object



14
15
16
17
18
19
20
21
22
23
24
25
# File 'lib/scribo/liquid/tags/include_tag.rb', line 14

def render(context)
  super

  content = context.registers['file_system'].read_template_file(argv1)

  result = ''
  context.stack do
    context['include'] = Scribo::IncludeDrop.new(attr_args.deep_stringify_keys)
    result += Liquidum.render(content, context: context, registers: context.registers)
  end
  result
end