Sha256: 49114b7ec04688de9dc3ad4edc26a98fc3f2351266f0d112b61717c8d96ee5b3

Contents?: true

Size: 1.72 KB

Versions: 51

Compression:

Stored size: 1.72 KB

Contents

# Default Middleman template
class Middleman::Templates::Default < Middleman::Templates::Base

  class_option "css_dir",
    :default => "stylesheets",
    :desc    => 'The path to the css files'
  class_option "js_dir",
    :default => "javascripts",
    :desc    => 'The path to the javascript files'
  class_option "images_dir",
    :default => "images",
    :desc    => 'The path to the image files'

  # Template files are relative to this file
  # @return [String]
  def self.source_root
    File.dirname(__FILE__)
  end

  # Actually output the files
  # @return [void]
  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
end

# Register this template
Middleman::Templates.register(:default, Middleman::Templates::Default)

Version data entries

51 entries across 51 versions & 2 rubygems

Version Path
middleman-core-3.2.1 lib/middleman-core/templates/default.rb
middleman-core-3.2.0 lib/middleman-core/templates/default.rb
middleman-core-3.1.6 lib/middleman-core/templates/default.rb
middleman-core-3.1.5 lib/middleman-core/templates/default.rb
middleman-core-3.1.4 lib/middleman-core/templates/default.rb
middleman-core-3.1.3 lib/middleman-core/templates/default.rb
middleman-core-3.1.2 lib/middleman-core/templates/default.rb
middleman-core-3.1.1 lib/middleman-core/templates/default.rb
middleman-core-3.1.0 lib/middleman-core/templates/default.rb
middleman-core-3.1.0.rc.4 lib/middleman-core/templates/default.rb
middleman-core-3.1.0.rc.3 lib/middleman-core/templates/default.rb
middleman-core-3.1.0.rc.2 lib/middleman-core/templates/default.rb
middleman-core-3.1.0.rc.1 lib/middleman-core/templates/default.rb
middleman-core-x86-mingw32-3.0.14 lib/middleman-core/templates/default.rb
middleman-core-3.0.14 lib/middleman-core/templates/default.rb
middleman-core-3.1.0.beta.3 lib/middleman-core/templates/default.rb
middleman-core-3.1.0.beta.2 lib/middleman-core/templates/default.rb
middleman-core-3.1.0.beta.1 lib/middleman-core/templates/default.rb
middleman-core-x86-mingw32-3.0.13 lib/middleman-core/templates/default.rb
middleman-core-3.0.13 lib/middleman-core/templates/default.rb