Class: Middleman::Util::BlogTemplateProcessor

Inherits:
Object
  • Object
show all
Defined in:
lib/middleman-core/util/uri_templates.rb

Overview

A special template processor that validates date fields and has an extra-permissive default regex.

See https://github.com/sporkmonger/addressable/blob/master/lib/addressable/template.rb#L279

Class Method Summary collapse

Class Method Details

.match(name) ⇒ Object


87
88
89
90
91
92
93
94
# File 'lib/middleman-core/util/uri_templates.rb', line 87

def self.match(name)
  case name
  when 'year' then '\d{4}'
  when 'month' then '\d{2}'
  when 'day' then '\d{2}'
  else '.*?'
  end
end