Skip to content

Commit 6f84b9a

Browse files
committed
generating files for template
1 parent 2a58a8f commit 6f84b9a

File tree

4 files changed

+48
-29
lines changed

4 files changed

+48
-29
lines changed

generators/app/index.js

+12-10
Original file line numberDiff line numberDiff line change
@@ -104,21 +104,23 @@ var ManGenerator = yeoman.generators.Base.extend({
104104
// Project index
105105
utils.generate.projectInfo.bind(this)();
106106

107-
// // Assets directories
108-
// utils.generate.assets.bind(this)();
107+
// Assets directories
108+
utils.generate.assets.bind(this)();
109109

110110
// // Template files
111-
// utils.generate.templateFiles.bind(this)();
111+
// utils.generate.templateFiles.bind(this)();
112112

113-
// // Styles
114-
// utils.generate.preprocessor.bind(this)();
113+
// Styles
114+
utils.generate.sass.bind(this)();
115115

116-
// // JS
117-
// utils.generate.js.bind(this)();
116+
// JS
117+
utils.generate.js.bind(this)();
118118

119-
// if (this.prompts.features.useBootstrap) {
120-
// utils.generate.bootstrap.bind(this)();
121-
// }
119+
if (this.prompts.features.jade) {
120+
utils.generate.jade.bind(this)();
121+
} else{
122+
utils.generate.html.bind(this)();
123+
}
122124
}
123125
// ,
124126

generators/app/templates/src/.keep

Whitespace-only changes.

generators/app/utils/generate.js

+34-17
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ var generate = {
2424
},
2525

2626
dotfiles: function () {
27-
// helpers.copy.call(this, 'bowerrc', '.bowerrc');
27+
helpers.copy.call(this, 'bowerrc', '.bowerrc');
2828
// helpers.copy.call(this, 'editorconfig', '.editorconfig');
2929
// helpers.copy.call(this, 'gitattributes', '.gitattributes');
3030
// helpers.copy.call(this, 'jshintrc', '.jshintrc');
@@ -45,26 +45,27 @@ var generate = {
4545
helpers.copy.call(this, 'gulp/helpers/sprite.template.mustache', 'gulp/helpers/sprite.template.mustache');
4646

4747

48-
var pkg = ['sass','iconfont','copy', 'html','jade','spritesmith','watch', 'js','server'];
49-
var arrayLength = pkg.length;
48+
var taskslist = ['sass','iconfont','copy', 'html','jade','spritesmith','watch', 'js','server'];
49+
var arrayLength = taskslist.length;
5050
var p,f;
5151

5252
for (var i = 0; i < arrayLength; i++) {
53-
f = 'gulp/tasks/' + pkg[i] + '.js';
53+
f = 'gulp/tasks/' + taskslist[i] + '.js';
5454
helpers.copy.call(this, f, f, this.prompts);
5555
}
5656
},
5757

5858
projectInfo: function () {
5959
// helpers.copy.call(this, '_index.html', 'index.html', this.prompts);
6060
helpers.copy.call(this, 'README.md', 'README.md', this.prompts);
61-
}
61+
},
6262

63-
// assets: function () {
64-
// helpers.copy.call(this, 'src/img/.keep', 'src/fonts/.keep');
65-
// helpers.copy.call(this, 'src/img/.keep', 'src/img/.keep');
66-
// helpers.copy.call(this, 'src/img/.keep', 'src/media/.keep');
67-
// },
63+
assets: function () {
64+
helpers.copy.call(this, 'src/.keep', 'src/fonts/.keep');
65+
helpers.copy.call(this, 'src/.keep', 'src/img/.keep');
66+
helpers.copy.call(this, 'src/.keep', 'src/img/icons/.keep');
67+
helpers.copy.call(this, 'src/.keep', 'src/img/svg/.keep');
68+
},
6869

6970
// templateFiles: function () {
7071
// helpers.copy.call(this, 'src/_template.html', 'src/template.' + this.prompts.extension, this.prompts);
@@ -75,14 +76,30 @@ var generate = {
7576
// helpers.copy.call(this, 'src/includes/_footer.html', 'src/includes/footer.' + this.prompts.extension, this.prompts);
7677
// helpers.copy.call(this, 'src/includes/_scripts.html', 'src/includes/scripts.' + this.prompts.extension, this.prompts);
7778
// },
79+
html: function (type, underscore) {
80+
helpers.copy.call(this, 'src/index.html', 'src/index.html', this.prompts);
81+
helpers.copy.call(this, 'src/partials/partial.html', 'src/partials/partial.html', this.prompts);
82+
},
83+
jade: function (type, underscore) {
84+
helpers.copy.call(this, 'src/jade/_layout.jade', 'src/jade/_layout.jade', this.prompts);
85+
helpers.copy.call(this, 'src/jade/index.jade', 'src/jade/index.jade', this.prompts);
86+
},
87+
sass: function (type, underscore) {
88+
helpers.copy.call(this, 'src/sass/style.sass', 'src/sass/style.sass', this.prompts);
89+
helpers.copy.call(this, 'src/sass/_common.sass', 'src/sass/_common.sass', this.prompts);
90+
helpers.copy.call(this, 'src/sass/_main.sass', 'src/sass/_main.sass', this.prompts);
91+
helpers.copy.call(this, 'src/sass/lib/_media.scss', 'src/sass/lib/_media.scss', this.prompts);
92+
helpers.copy.call(this, 'src/sass/lib/_mixins.sass', 'src/sass/lib/_mixins.sass', this.prompts);
93+
helpers.copy.call(this, 'src/sass/lib/_reset.sass', 'src/sass/lib/_reset.sass', this.prompts);
94+
helpers.copy.call(this, 'src/sass/lib/_slick.sass', 'src/sass/lib/_slick.sass', this.prompts);
95+
},
7896

79-
// preprocessor: function (type, underscore) {
80-
// helpers.createStructure.bind(this)(helpers.getStructure.bind(this)().default, 'src/' + this.prompts.cssPreprocessor);
81-
// },
82-
83-
// js: function () {
84-
// helpers.copy.call(this, 'src/js/_main.js', 'src/js/main.js', this.prompts);
85-
// },
97+
js: function () {
98+
helpers.copy.call(this, 'src/js/app.js', 'src/js/app.js', this.prompts);
99+
helpers.copy.call(this, 'src/js/common.js', 'src/js/common.js', this.prompts);
100+
helpers.copy.call(this, 'src/js/lib/jquery.js', 'src/js/lib/jquery.js', this.prompts);
101+
helpers.copy.call(this, 'src/js/lib/slick.min.js', 'src/js/lib/slick.min.js', this.prompts);
102+
},
86103

87104
// wp: function () {
88105
// this.fs.write(this.destinationPath(this.prompts.wpThemeFolder + '/.keep'), '');

generators/app/utils/prompts.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@ module.exports = {
99
},
1010
{
1111
type: 'confirm',
12-
name: 'bootstrap',
13-
message: 'Do we need bootstrap here?',
12+
name: 'jade',
13+
message: 'Do we need Jade?',
1414
default: false
1515
}],
1616

0 commit comments

Comments
 (0)