Class: Middleman::Templates::Default

Inherits:
Base
  • Object
show all
Defined in:
lib/middleman-core/templates/default.rb

Overview

Default Middleman template

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from Base

#generate_bundler!, #generate_gitignore!, #generate_rack!, #initialize

Constructor Details

This class inherits a constructor from Middleman::Templates::Base

Class Method Details

.source_rootString

Template files are relative to this file

Returns:

  • (String)


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", options[:css_dir])
  copy_file "default/source/stylesheets/all.css", File.join(location, "source", options[:css_dir], "all.css")
  copy_file "default/source/stylesheets/normalize.css", File.join(location, "source", options[:css_dir], "normalize.css")
  empty_directory File.join(location, "source", options[:js_dir])
  copy_file "default/source/javascripts/all.js", File.join(location, "source", options[:js_dir], "all.js")
  empty_directory File.join(location, "source", options[:images_dir])
  copy_file "default/source/images/background.png", File.join(location, "source", options[:images_dir], "background.png")
  copy_file "default/source/images/middleman.png", File.join(location, "source", options[:images_dir], "middleman.png")
end