Module: Roda::RodaPlugins::Partials::InstanceMethods

Defined in:
lib/roda/plugins/partials.rb

Instance Method Summary collapse

Instance Method Details

#partial(template, opts = OPTS) ⇒ Object

Renders the given template without a layout, but prefixes the template filename to use with an underscore.



36
37
38
39
40
41
42
43
44
# File 'lib/roda/plugins/partials.rb', line 36

def partial(template, opts=OPTS)
  opts = parse_template_opts(template, opts)
  if opts[:template]
    template = opts[:template].split(SLASH)
    template[-1] = "_#{template[-1]}"
    opts[:template] = template.join(SLASH)
  end
  render_template(opts)
end