2011-12-10 11:17:47 -08:00
|
|
|
# Local templates
|
2011-04-16 16:23:10 -07:00
|
|
|
class Middleman::Templates::Local < Middleman::Templates::Base
|
2014-03-24 10:29:21 +00:00
|
|
|
# Look for templates inside .middleman in the user's home directory
|
2011-12-17 20:12:13 -08:00
|
|
|
# @return [String]
|
2011-04-16 16:23:10 -07:00
|
|
|
def self.source_root
|
2014-03-24 10:29:21 +00:00
|
|
|
File.join(Dir.home, '.middleman')
|
2011-04-16 16:23:10 -07:00
|
|
|
end
|
|
|
|
|
2011-12-10 11:17:47 -08:00
|
|
|
# Just copy from the template path
|
2011-12-17 20:12:13 -08:00
|
|
|
# @return [void]
|
|
|
|
def build_scaffold!
|
2011-04-16 16:23:10 -07:00
|
|
|
directory options[:template].to_s, location
|
2012-08-13 15:39:06 -07:00
|
|
|
end
|
2011-04-16 16:23:10 -07:00
|
|
|
end
|
|
|
|
|
2014-03-13 10:57:19 +00:00
|
|
|
# Register this template
|
|
|
|
Middleman::Templates.register(:local, Middleman::Templates::Local)
|