Method: Alongslide::Templates.load

Defined in:
lib/alongslide/templates.rb

.load(name, is_user_template = false) ⇒ Object

Load template, which consists of HAML + Middleman-style frontmatter.

Parameters:

  • is_user_template (defaults to: false)
    • true if requested template is user-generated,

    not one of the basic bundled ones.



61
62
63
64
65
66
# File 'lib/alongslide/templates.rb', line 61

def load(name, is_user_template = false)
  template = IO.read(template_path(name, is_user_template))
  yaml, haml = split_frontmatter(template)
  params = YAML.load yaml
  return params, haml
end