diff --git a/app/index.js b/app/index.js
index 9fc2939..18468b4 100644
--- a/app/index.js
+++ b/app/index.js
@@ -15,7 +15,12 @@
});
},
+ hasFeature: function (list, feat) {
+ return (list || []).indexOf(feat) !== -1;
+ },
+
askFor: function () {
+ var scope = this;
var done = this.async();
// have Yeoman greet the user
@@ -27,7 +32,7 @@
var prompts = [
{
type: 'checkbox',
- name: 'features',
+ name: 'Features',
message: 'What more would you like?',
default: true,
choices: [
@@ -37,16 +42,21 @@
checked: true
}
]
+ },
+ {
+ type: 'confirm',
+ name: 'HTML5Shiv',
+ value: 'includeHTML5Shiv',
+ message: 'Would you like to use a crossbrowser workaround to ' + chalk.red('HTML5') + '?',
+ when: function (answers) {
+ return !scope.hasFeature(answers.Features, 'includeModernizr');
+ }
}
];
- this.hasFeature = function (list, feat) {
- return list.indexOf(feat) !== -1;
- };
-
this.prompt(prompts, function (props) {
- var features = (props.features || []);
- this.includeModernizr = this.hasFeature(features, 'includeModernizr');
+ this.includeModernizr = this.hasFeature(props.Features, 'includeModernizr');
+ this.includeHTML5Shiv = props.HTML5Shiv;
done();
}.bind(this));
},
diff --git a/app/templates/_bower.json b/app/templates/_bower.json
index d015688..46630e5 100644
--- a/app/templates/_bower.json
+++ b/app/templates/_bower.json
@@ -5,7 +5,8 @@
"private": true,
"dependencies": {
"requirejs": "~2.1.11",<% if (includeModernizr) { %>
- "modernizr": "~2.6.2",<% } %>
+ "modernizr": "~2.6.2",<% } else { if (includeHTML5Shiv) { %>
+ "html5shiv": "~3.7.0",<% }} %>
"jquery": "~2.1.0"
},
"devDependencies": {},
diff --git a/app/templates/_gulpfile.js b/app/templates/_gulpfile.js
index c4f4d25..97fd987 100644
--- a/app/templates/_gulpfile.js
+++ b/app/templates/_gulpfile.js
@@ -4,8 +4,7 @@
//|
//| Gulpfile
//|
- //| This file is the streaming build system generated on <%= (new Date).toISOString().split('T')[0] %>
- //| using <%= pkg.name %> <%= pkg.version %>
+ //| This file is the streaming build system
//|
//| .--------------------------------------------------------------.
//| | NAMING CONVENTIONS: |
@@ -175,7 +174,7 @@
//'~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
gulp.task('html', ['styles', 'scripts'], function() {
var js = $.filter('**/*.js'), css = $.filter('**/*.css');
- return gulp.src(_.app + '/*.html')
+ return gulp.src([_.app + '/*.html'])
.pipe($.useref.assets())
.pipe(js)
.pipe($.uglify())
@@ -186,7 +185,13 @@
.pipe($.useref.restore())
.pipe($.useref())
.pipe(gulp.dest(_.dist))
- .pipe($.size());
+ .pipe($.size())
+ .pipe($.notify({
+ message: '<%= options.date %> ✓ html: <%= file.relative %>',
+ templateOptions: {
+ date: new Date()
+ }
+ }));
});
//|**~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
diff --git a/app/templates/app/index.html b/app/templates/app/index.html
index 809bcc0..993c238 100644
--- a/app/templates/app/index.html
+++ b/app/templates/app/index.html
@@ -17,7 +17,12 @@
<% if (includeModernizr) { %>
- <% } %>
+ <% } else { if (includeHTML5Shiv) { %>
+
+
+
+ <% }} %>