2011-04-16 19:23:10 -04:00
|
|
|
module Middleman
|
|
|
|
def self.templates_path
|
2011-08-08 17:01:04 -04:00
|
|
|
File.join(File.expand_path("~/"), ".middleman")
|
2011-04-16 19:23:10 -04:00
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
class Middleman::Templates::Local < Middleman::Templates::Base
|
|
|
|
def self.source_root
|
|
|
|
Middleman.templates_path
|
|
|
|
end
|
|
|
|
|
|
|
|
def build_scaffold
|
|
|
|
directory options[:template].to_s, location
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
Dir[File.join(Middleman.templates_path, "*")].each do |dir|
|
|
|
|
next unless File.directory?(dir)
|
|
|
|
Middleman::Templates.register(File.basename(dir).to_sym, Middleman::Templates::Local)
|
2011-08-08 17:01:04 -04:00
|
|
|
end
|