Class: Middleman::Templates::Default
- Defined in:
- lib/middleman-core/templates/default.rb
Overview
Default Middleman template
Class Method Summary collapse
-
.source_root ⇒ String
Template files are relative to this file.
Instance Method Summary collapse
-
#build_scaffold! ⇒ void
Actually output the files.
Methods inherited from Base
gemfile_template, #generate_bundler!, #generate_gitignore!, #generate_rack!, #initialize
Constructor Details
This class inherits a constructor from Middleman::Templates::Base
Class Method Details
.source_root ⇒ String
Template files are relative to this file
16 17 18 |
# File 'lib/middleman-core/templates/default.rb', line 16 def self.source_root File.dirname(__FILE__) end |
Instance Method Details
#build_scaffold! ⇒ void
This method returns an undefined value.
Actually output the files
22 23 24 25 26 27 28 29 30 31 32 33 34 |
# File 'lib/middleman-core/templates/default.rb', line 22 def build_scaffold! template "shared/config.tt", File.join(location, "config.rb") copy_file "default/source/index.html.erb", File.join(location, "source/index.html.erb") copy_file "default/source/layouts/layout.erb", File.join(location, "source/layouts/layout.erb") empty_directory File.join(location, "source", [:css_dir]) copy_file "default/source/stylesheets/all.css", File.join(location, "source", [:css_dir], "all.css") copy_file "default/source/stylesheets/normalize.css", File.join(location, "source", [:css_dir], "normalize.css") empty_directory File.join(location, "source", [:js_dir]) copy_file "default/source/javascripts/all.js", File.join(location, "source", [:js_dir], "all.js") empty_directory File.join(location, "source", [:images_dir]) copy_file "default/source/images/background.png", File.join(location, "source", [:images_dir], "background.png") copy_file "default/source/images/middleman.png", File.join(location, "source", [:images_dir], "middleman.png") end |