Skip to content

Commit effdf9d

Browse files
update nunjucks preview\not preview variants
1 parent 4c19447 commit effdf9d

File tree

1 file changed

+8
-10
lines changed

1 file changed

+8
-10
lines changed

generators/app/writing.js

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -45,9 +45,10 @@ module.exports = function () {
4545
this.fs.copy(this.templatePath('gulp/tasks/clean.js'),'gulp/tasks/clean.js');
4646
this.fs.copy(this.templatePath('gulp/tasks/server.js'),'gulp/tasks/server.js');
4747

48-
this.fs.copy(this.templatePath('gulp/tasks/index/index.html'),'gulp/tasks/index/index.html');
49-
this.fs.copy(this.templatePath('gulp/tasks/list-pages.js'),'gulp/tasks/list-pages.js');
50-
48+
if(props.preview){
49+
this.fs.copy(this.templatePath('gulp/tasks/index/index.html'),'gulp/tasks/index/index.html');
50+
this.fs.copy(this.templatePath('gulp/tasks/list-pages.js'),'gulp/tasks/list-pages.js');
51+
}
5152

5253

5354
this.sprites = props.sprites; // or in /templates/src/sass/app.sass use options.sprites
@@ -172,17 +173,14 @@ module.exports = function () {
172173
this.fs.copyTpl(this.templatePath('src/sass/app.sss'), 'src/sass/app.sss',props);
173174
}
174175

175-
176-
177-
178-
179-
180176

181177
switch (props.templates) {
182178
case 'nunjucks':
183179
this.fs.copy(this.templatePath('src/templates-nunjucks'), 'src/templates');
184-
this.fs.delete('src/templates/page.html');
185-
this.fs.copy(this.templatePath('src/templates-nunjucks/page.html'), 'src/templates/index.html');
180+
if(!props.preview){
181+
this.fs.delete('src/templates/page.html');
182+
this.fs.copy(this.templatePath('src/templates-nunjucks/page.html'), 'src/templates/index.html');
183+
}
186184
break;
187185
case 'swig':
188186
this.fs.copy(this.templatePath('src/templates-swig'), 'src/templates');

0 commit comments

Comments
 (0)