class Locomotive::Steam::Liquid::Template

Public Class Methods

parse(source, options = {}) click to toggle source
# File lib/locomotive/steam/liquid/template.rb, line 20
def parse(source, options = {})
  template = new
  template.parse(source, options.merge({
    line_numbers: true
  }))
end

Public Instance Methods

render(*args) click to toggle source

When we render a Locomotive template, we need to know what are the default content of all the editable elements. Without this, developers are unable to use statements like the following: {{ page.editable_elements.content.header.title }}

Calls superclass method
# File lib/locomotive/steam/liquid/template.rb, line 10
def render(*args)
  if args.first && args.first.is_a?(::Liquid::Context)
    content = @options[:default_editable_content]
    args.first.registers[:default_editable_content] = content
  end

  super
end