Module: Middleman::Templates

Defined in:
lib/middleman-core/templates.rb

Overview

Templates namespace

Defined Under Namespace

Classes: Base, Default, Empty, Html5, Local, Mobile, Smacss

Class Method Summary collapse

Class Method Details

.register(name = nil, klass = nil) ⇒ Hash Also known as: registered

Get list of registered templates and add new ones

Middleman::Templates.register(:ext_name, klass)

Parameters:

  • name (Symbol) (defaults to: nil)

    The name of the template

  • klass (Class) (defaults to: nil)

    The class to be executed for this template

Returns:

  • (Hash)

    List of registered templates



18
19
20
21
22
# File 'lib/middleman-core/templates.rb', line 18

def register(name=nil, klass=nil)
  @_template_mappings ||= {}
  @_template_mappings[name] = klass if name && klass
  @_template_mappings
end