2011-04-12 23:32:13 -04:00
|
|
|
require "thor"
|
|
|
|
require "thor/group"
|
|
|
|
|
|
|
|
module Middleman::Templates
|
|
|
|
@@template_mappings = {}
|
|
|
|
def self.register(name, klass)
|
|
|
|
@@template_mappings[name] = klass
|
|
|
|
end
|
|
|
|
|
|
|
|
def self.registered_names
|
|
|
|
@@template_mappings.keys
|
|
|
|
end
|
|
|
|
|
|
|
|
def self.registered_templates
|
|
|
|
@@template_mappings
|
|
|
|
end
|
|
|
|
|
|
|
|
class Base < ::Thor::Group
|
|
|
|
include Thor::Actions
|
|
|
|
|
|
|
|
argument :location, :type => :string
|
2011-04-16 19:23:10 -04:00
|
|
|
class_option :template, :default => "default"
|
|
|
|
class_option :css_dir, :default => "stylesheets"
|
|
|
|
class_option :js_dir, :default => "javascripts"
|
|
|
|
class_option :images_dir, :default => "images"
|
2011-04-12 23:32:13 -04:00
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
# Default template
|
|
|
|
require "middleman/templates/default"
|
2011-04-16 19:23:10 -04:00
|
|
|
|
2011-04-12 23:32:13 -04:00
|
|
|
# HTML5 template
|
2011-04-16 19:23:10 -04:00
|
|
|
require "middleman/templates/html5"
|
|
|
|
|
|
|
|
# Local templates
|
|
|
|
require "middleman/templates/local"
|