Class: Middleman::Util::BlogTemplateProcessor

Inherits:
Object
  • Object
show all
Defined in:
middleman-core/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


84
85
86
87
88
89
90
91
# File 'middleman-core/lib/middleman-core/util/uri_templates.rb', line 84

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