diff --git a/features/generator.feature b/features/generator.feature
index b6f1c01c..0809c36b 100644
--- a/features/generator.feature
+++ b/features/generator.feature
@@ -1,8 +1,16 @@
Feature: Generator
- In order to generate static assets for client
Scenario: Copying template files
- Given a project at "generator-test"
- And the project has been initialized
- Then template files should exist
- And empty directories should exist
\ No newline at end of file
+ Given I run `middleman init generator-test`
+ Then the exit status should be 0
+ When I cd to "generator-test"
+ Then the following files should exist:
+ | config.rb |
+ | source/index.html.erb |
+ | source/images/background.png |
+ | source/images/middleman.png |
+ | source/layouts/layout.erb |
+ | source/javascripts/all.js |
+ | source/stylesheets/all.css.scss |
+ | source/stylesheets/_animate.scss |
+ | source/stylesheets/_normalize.scss |
\ No newline at end of file
diff --git a/lib/middleman/step_definitions.rb b/lib/middleman/step_definitions.rb
index 0fa95192..acc1eb16 100644
--- a/lib/middleman/step_definitions.rb
+++ b/lib/middleman/step_definitions.rb
@@ -5,7 +5,6 @@ ENV['PATH'] = "#{MIDDLEMAN_BIN_PATH}#{File::PATH_SEPARATOR}#{ENV['PATH']}"
require "aruba/cucumber"
require "middleman/step_definitions/middleman_steps"
require "middleman/step_definitions/builder_steps"
-require "middleman/step_definitions/generator_steps"
require "middleman/step_definitions/server_steps"
Before do
diff --git a/lib/middleman/step_definitions/generator_steps.rb b/lib/middleman/step_definitions/generator_steps.rb
deleted file mode 100644
index d6bb5478..00000000
--- a/lib/middleman/step_definitions/generator_steps.rb
+++ /dev/null
@@ -1,26 +0,0 @@
-require 'fileutils'
-
-Given /^the project has been initialized$/ do
- step %Q{the project should be cleaned up}
- init_cmd = File.join(MIDDLEMAN_BIN_PATH, "middleman init")
- `cd #{File.dirname(@target)} && #{init_cmd} #{File.basename(@target)}`
-end
-
-Then /^template files should exist$/ do
- template_glob = File.join(MIDDLEMAN_ROOT_PATH, "lib", "middleman", "templates", "default", "*/**/*")
-
- Dir[template_glob].each do |f|
- next if File.directory?(f)
- File.exists?("#{@target}/#{f.split('template/')[1]}").should be_true
- end
-end
-
-Then /^empty directories should exist$/ do
- %w(source/stylesheets source/javascripts source/images).each do |d|
- File.exists?("#{@target}/#{d}").should be_true
- end
-end
-
-Then /^the project should be cleaned up$/ do
- FileUtils.rm_rf(@target)
-end
\ No newline at end of file
diff --git a/lib/middleman/templates/default.rb b/lib/middleman/templates/default.rb
index a810bdd9..f7fbc658 100644
--- a/lib/middleman/templates/default.rb
+++ b/lib/middleman/templates/default.rb
@@ -12,11 +12,16 @@ class Middleman::Templates::Default < Middleman::Templates::Base
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/layout.erb", File.join(location, "source/layout.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/site.css.scss", File.join(location, "source", options[:css_dir], "site.css.scss")
+ copy_file "default/source/stylesheets/all.css.scss", File.join(location, "source", options[:css_dir], "all.css.scss")
+ copy_file "default/source/stylesheets/_animate.scss", File.join(location, "source", options[:css_dir], "_animate.scss")
+ copy_file "default/source/stylesheets/_normalize.scss", File.join(location, "source", options[:css_dir], "_normalize.scss")
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
diff --git a/lib/middleman/templates/default/source/images/background.png b/lib/middleman/templates/default/source/images/background.png
new file mode 100644
index 00000000..8681d44f
Binary files /dev/null and b/lib/middleman/templates/default/source/images/background.png differ
diff --git a/lib/middleman/templates/default/source/images/middleman.png b/lib/middleman/templates/default/source/images/middleman.png
new file mode 100644
index 00000000..c685e564
Binary files /dev/null and b/lib/middleman/templates/default/source/images/middleman.png differ
diff --git a/lib/middleman/templates/default/source/index.html.erb b/lib/middleman/templates/default/source/index.html.erb
old mode 100755
new mode 100644
index 5c011522..7537cd68
--- a/lib/middleman/templates/default/source/index.html.erb
+++ b/lib/middleman/templates/default/source/index.html.erb
@@ -1,5 +1,10 @@
-<% content_for :head do %>
-
The Middleman!
-<% end %>
+---
+title: Welcome to Middleman
+---
-The Middleman is watching.
\ No newline at end of file
+
+
Middleman is Watching
+
+ <%= link_to "Read Online Documentation", "http://middlemanapp.com/" %>
+
+
\ No newline at end of file
diff --git a/lib/middleman/templates/default/source/javascripts/all.js b/lib/middleman/templates/default/source/javascripts/all.js
new file mode 100644
index 00000000..2becd765
--- /dev/null
+++ b/lib/middleman/templates/default/source/javascripts/all.js
@@ -0,0 +1 @@
+//= require_tree .
\ No newline at end of file
diff --git a/lib/middleman/templates/default/source/layout.erb b/lib/middleman/templates/default/source/layout.erb
deleted file mode 100644
index 9416394d..00000000
--- a/lib/middleman/templates/default/source/layout.erb
+++ /dev/null
@@ -1,19 +0,0 @@
-
-
-
-
-
-
-
- <%= stylesheet_link_tag "site.css" %>
- <%= yield_content :head %>
-
-
-
-
-
- <%= yield %>
-
-
-
-
\ No newline at end of file
diff --git a/lib/middleman/templates/default/source/layouts/layout.erb b/lib/middleman/templates/default/source/layouts/layout.erb
new file mode 100644
index 00000000..4628ce53
--- /dev/null
+++ b/lib/middleman/templates/default/source/layouts/layout.erb
@@ -0,0 +1,19 @@
+
+
+
+
+
+
+
+
+
+ <%= data.page.title || "The Middleman" %>
+
+ <%= stylesheet_link_tag "all" %>
+ <%= javascript_include_tag "all" %>
+
+
+
+ <%= yield %>
+
+
\ No newline at end of file
diff --git a/lib/middleman/templates/default/source/stylesheets/_animate.scss b/lib/middleman/templates/default/source/stylesheets/_animate.scss
new file mode 100644
index 00000000..bc87b07c
--- /dev/null
+++ b/lib/middleman/templates/default/source/stylesheets/_animate.scss
@@ -0,0 +1,23 @@
+.welcome {
+ -webkit-animation-name: welcome;
+ -webkit-animation-duration: .9s;
+}
+
+@-webkit-keyframes welcome {
+ from {
+ -webkit-transform: scale(0);
+ opacity: 0;
+ }
+ 50% {
+ -webkit-transform: scale(0);
+ opacity: 0;
+ }
+ 82.5% {
+ -webkit-transform: scale(1.03);
+ -webkit-animation-timing-function: ease-out;
+ opacity: 1;
+ }
+ to {
+ -webkit-transform: scale(1);
+ }
+}
\ No newline at end of file
diff --git a/lib/middleman/templates/default/source/stylesheets/_normalize.scss b/lib/middleman/templates/default/source/stylesheets/_normalize.scss
new file mode 100644
index 00000000..97768133
--- /dev/null
+++ b/lib/middleman/templates/default/source/stylesheets/_normalize.scss
@@ -0,0 +1,431 @@
+/*! normalize.css 2011-11-04T15:38 UTC - http://github.com/necolas/normalize.css */
+
+/* =============================================================================
+ HTML5 display definitions
+ ========================================================================== */
+
+/*
+ * Corrects block display not defined in IE6/7/8/9 & FF3
+ */
+
+article,
+aside,
+details,
+figcaption,
+figure,
+footer,
+header,
+hgroup,
+nav,
+section {
+ display: block;
+}
+
+/*
+ * Corrects inline-block display not defined in IE6/7/8/9 & FF3
+ */
+
+audio,
+canvas,
+video {
+ display: inline-block;
+ *display: inline;
+ *zoom: 1;
+}
+
+/*
+ * Prevents modern browsers from displaying 'audio' without controls
+ */
+
+audio:not([controls]) {
+ display: none;
+}
+
+/*
+ * Addresses styling for 'hidden' attribute not present in IE7/8/9, FF3, S4
+ * Known issue: no IE6 support
+ */
+
+[hidden] {
+ display: none;
+}
+
+
+/* =============================================================================
+ Base
+ ========================================================================== */
+
+/*
+ * 1. Corrects text resizing oddly in IE6/7 when body font-size is set using em units
+ * http://clagnut.com/blog/348/#c790
+ * 2. Keeps page centred in all browsers regardless of content height
+ * 3. Prevents iOS text size adjust after orientation change, without disabling user zoom
+ * www.456bereastreet.com/archive/201012/controlling_text_size_in_safari_for_ios_without_disabling_user_zoom/
+ */
+
+html {
+ font-size: 100%; /* 1 */
+ overflow-y: scroll; /* 2 */
+ -webkit-text-size-adjust: 100%; /* 3 */
+ -ms-text-size-adjust: 100%; /* 3 */
+}
+
+/*
+ * Addresses margins handled incorrectly in IE6/7
+ */
+
+body {
+ margin: 0;
+}
+
+/*
+ * Addresses font-family inconsistency between 'textarea' and other form elements.
+ */
+
+body,
+button,
+input,
+select,
+textarea {
+ font-family: sans-serif;
+}
+
+
+/* =============================================================================
+ Links
+ ========================================================================== */
+
+/*
+ * Addresses outline displayed oddly in Chrome
+ */
+
+a:focus {
+ outline: thin dotted;
+}
+
+/*
+ * Improves readability when focused and also mouse hovered in all browsers
+ * people.opera.com/patrickl/experiments/keyboard/test
+ */
+
+a:hover,
+a:active {
+ outline: 0;
+}
+
+
+/* =============================================================================
+ Typography
+ ========================================================================== */
+
+/*
+ * Neutralise smaller font-size in 'section' and 'article' in FF4+, Chrome, S5
+ */
+
+h1 {
+ font-size: 2em;
+}
+
+/*
+ * Addresses styling not present in IE7/8/9, S5, Chrome
+ */
+
+abbr[title] {
+ border-bottom: 1px dotted;
+}
+
+/*
+ * Addresses style set to 'bolder' in FF3+, S4/5, Chrome
+*/
+
+b,
+strong {
+ font-weight: bold;
+}
+
+blockquote {
+ margin: 1em 40px;
+}
+
+/*
+ * Addresses styling not present in S5, Chrome
+ */
+
+dfn {
+ font-style: italic;
+}
+
+/*
+ * Addresses styling not present in IE6/7/8/9
+ */
+
+mark {
+ background: #ff0;
+ color: #000;
+}
+
+/*
+ * Corrects font family set oddly in IE6, S4/5, Chrome
+ * en.wikipedia.org/wiki/User:Davidgothberg/Test59
+ */
+
+pre,
+code,
+kbd,
+samp {
+ font-family: monospace, serif;
+ _font-family: 'courier new', monospace;
+ font-size: 1em;
+}
+
+/*
+ * Improves readability of pre-formatted text in all browsers
+ */
+
+pre {
+ white-space: pre;
+ white-space: pre-wrap;
+ word-wrap: break-word;
+}
+
+/*
+ * 1. Addresses CSS quotes not supported in IE6/7
+ * 2. Addresses quote property not supported in S4
+ */
+
+/* 1 */
+
+q {
+ quotes: none;
+}
+
+/* 2 */
+
+q:before,
+q:after {
+ content: '';
+ content: none;
+}
+
+small {
+ font-size: 75%;
+}
+
+/*
+ * Prevents sub and sup affecting line-height in all browsers
+ * gist.github.com/413930
+ */
+
+sub,
+sup {
+ font-size: 75%;
+ line-height: 0;
+ position: relative;
+ vertical-align: baseline;
+}
+
+sup {
+ top: -0.5em;
+}
+
+sub {
+ bottom: -0.25em;
+}
+
+
+/* =============================================================================
+ Lists
+ ========================================================================== */
+
+ul,
+ol {
+ margin-left: 0;
+ padding: 0 0 0 40px;
+}
+
+dd {
+ margin: 0 0 0 40px;
+}
+
+nav ul,
+nav ol {
+ list-style: none;
+ list-style-image: none;
+}
+
+
+/* =============================================================================
+ Embedded content
+ ========================================================================== */
+
+/*
+ * 1. Removes border when inside 'a' element in IE6/7/8/9, FF3
+ * 2. Improves image quality when scaled in IE7
+ * code.flickr.com/blog/2008/11/12/on-ui-quality-the-little-things-client-side-image-resizing/
+ */
+
+img {
+ border: 0; /* 1 */
+ -ms-interpolation-mode: bicubic; /* 2 */
+}
+
+/*
+ * Corrects overflow displayed oddly in IE9
+ */
+
+svg:not(:root) {
+ overflow: hidden;
+}
+
+
+/* =============================================================================
+ Figures
+ ========================================================================== */
+
+/*
+ * Addresses margin not present in IE6/7/8/9, S5, O11
+ */
+
+figure {
+ margin: 0;
+}
+
+
+/* =============================================================================
+ Forms
+ ========================================================================== */
+
+/*
+ * Corrects margin displayed oddly in IE6/7
+ */
+
+form {
+ margin: 0;
+}
+
+/*
+ * Define consistent border, margin, and padding
+ */
+
+fieldset {
+ border: 1px solid #c0c0c0;
+ margin: 0 2px;
+ padding: 0.35em 0.625em 0.75em;
+}
+
+/*
+ * 1. Corrects color not being inherited in IE6/7/8/9
+ * 2. Corrects alignment displayed oddly in IE6/7
+ */
+
+legend {
+ border: 0; /* 1 */
+ *margin-left: -7px; /* 2 */
+}
+
+/*
+ * 1. Corrects font size not being inherited in all browsers
+ * 2. Addresses margins set differently in IE6/7, FF3+, S5, Chrome
+ * 3. Improves appearance and consistency in all browsers
+ */
+
+button,
+input,
+select,
+textarea {
+ font-size: 100%; /* 1 */
+ margin: 0; /* 2 */
+ vertical-align: baseline; /* 3 */
+ *vertical-align: middle; /* 3 */
+}
+
+/*
+ * Addresses FF3/4 setting line-height on 'input' using !important in the UA stylesheet
+ */
+
+button,
+input {
+ line-height: normal; /* 1 */
+}
+
+/*
+ * 1. Improves usability and consistency of cursor style between image-type 'input' and others
+ * 2. Corrects inability to style clickable 'input' types in iOS
+ * 3. Removes inner spacing in IE7 without affecting normal text inputs
+ * Known issue: inner spacing remains in IE6
+ */
+
+button,
+input[type="button"],
+input[type="reset"],
+input[type="submit"] {
+ cursor: pointer; /* 1 */
+ -webkit-appearance: button; /* 2 */
+ *overflow: visible; /* 3 */
+}
+
+/*
+ * 1. Addresses box sizing set to content-box in IE8/9
+ * 2. Removes excess padding in IE8/9
+ */
+
+input[type="checkbox"],
+input[type="radio"] {
+ box-sizing: border-box; /* 1 */
+ padding: 0; /* 2 */
+}
+
+/*
+ * 1. Addresses appearance set to searchfield in S5, Chrome
+ * 2. Addresses box-sizing set to border-box in S5, Chrome (include -moz to future-proof)
+ */
+
+input[type="search"] {
+ -webkit-appearance: textfield; /* 1 */
+ -moz-box-sizing: content-box;
+ -webkit-box-sizing: content-box; /* 2 */
+ box-sizing: content-box;
+}
+
+/*
+ * Removes inner padding that is displayed in S5, Chrome on OS X
+ */
+
+input[type="search"]::-webkit-search-decoration {
+ -webkit-appearance: none;
+}
+
+/*
+ * Removes inner padding and border in FF3+
+ * www.sitepen.com/blog/2008/05/14/the-devils-in-the-details-fixing-dojos-toolbar-buttons/
+ */
+
+button::-moz-focus-inner,
+input::-moz-focus-inner {
+ border: 0;
+ padding: 0;
+}
+
+/*
+ * 1. Removes default vertical scrollbar in IE6/7/8/9
+ * 2. Improves readability and alignment in all browsers
+ */
+
+textarea {
+ overflow: auto; /* 1 */
+ vertical-align: top; /* 2 */
+}
+
+
+/* =============================================================================
+ Tables
+ ========================================================================== */
+
+/*
+ * Remove most spacing between table cells
+ */
+
+table {
+ border-collapse: collapse;
+ border-spacing: 0;
+}
diff --git a/lib/middleman/templates/default/source/stylesheets/all.css.scss b/lib/middleman/templates/default/source/stylesheets/all.css.scss
new file mode 100644
index 00000000..8c091dec
--- /dev/null
+++ b/lib/middleman/templates/default/source/stylesheets/all.css.scss
@@ -0,0 +1,40 @@
+@charset "utf-8";
+
+@import "normalize";
+@import "compass";
+
+body {
+ background: #d4d4d4 image-url("background.png");
+ text-align: center;
+ font-family: sans-serif;
+}
+
+h1 {
+ color: rgba(black, .3);
+ font-weight: bold;
+ @include adjust-font-size-to(32px);
+ letter-spacing: -1px;
+ text-transform: uppercase;
+ text-shadow: 0 1px 0 rgba(white, .5);
+ background: image-url("middleman.png") no-repeat center 100px;
+ padding: 350px 0 10px;
+ margin: 0;
+}
+
+.doc {
+ @include adjust-font-size-to(14px);
+ margin: 0;
+ &:before,
+ &:after {
+ opacity: .2;
+ padding: 6px;
+ font-style: normal;
+ position: relative;
+ content: "•";
+ }
+ a {
+ @include link-colors( rgba( black, .3 ) , #666);
+ }
+}
+
+@import "animate";
\ No newline at end of file
diff --git a/lib/middleman/templates/default/source/stylesheets/site.css.scss b/lib/middleman/templates/default/source/stylesheets/site.css.scss
deleted file mode 100644
index bd045ca6..00000000
--- a/lib/middleman/templates/default/source/stylesheets/site.css.scss
+++ /dev/null
@@ -1,32 +0,0 @@
-@import "compass";
-
-$link-color: #0388a6;
-$link-hover-color: #009ce0;
-$link-focus-color: false;
-$link-active-color: false;
-$link-visited-color: false;
-
-$font-color: #2a2a2a;
-$font-family: sans-serif;
-$base-font-size: 12px;
-$base-line-height: 18px;
-
-$total-cols: 12;
-$col-width: 4em;
-$gutter-width: 1em;
-$side-gutter-width: $gutter-width;
-
-@include global-reset;
-
-body {
- font-family: $font-family;
- color: $font-color;
-}
-
-a {
- @include link-colors($link-color, $link-hover-color, $link-focus-color, $link-active-color, $link-visited-color);
-}
-
-#main {
- padding: 50px;
-}
\ No newline at end of file
diff --git a/lib/middleman/templates/shared/config.tt b/lib/middleman/templates/shared/config.tt
index fe508731..889e66a5 100755
--- a/lib/middleman/templates/shared/config.tt
+++ b/lib/middleman/templates/shared/config.tt
@@ -12,22 +12,7 @@
# end
###
-# Haml
-###
-
-# CodeRay syntax highlighting in Haml
-# First: gem install haml-coderay
-# require 'haml-coderay'
-
-# CoffeeScript filters in Haml
-# First: gem install coffee-filter
-# require 'coffee-filter'
-
-# Automatic image dimensions on image_tag helper
-# activate :automatic_image_sizes
-
-###
-# Page command
+# Page options, layouts, aliases and proxies
###
# Per-page layout changes:
@@ -52,6 +37,9 @@
# Helpers
###
+# Automatic image dimensions on image_tag helper
+# activate :automatic_image_sizes
+
# Methods defined in the helpers block are available in templates
# helpers do
# def some_helper