Advertisement
Guest User

Untitled

a guest
Jul 25th, 2017
69
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.64 KB | None | 0 0
  1. var getJsonData = function(file) {
  2. return require(path.dirname(file.path) + '/' + path.basename(file.path, '.nunjucks') + '.json');
  3. };
  4.  
  5.  
  6. gulp.task('json', function() {
  7. return gulp.src('./build/nunjucks/pages/**/*.nunjucks')
  8. .pipe(data(getJsonData))
  9. .pipe( gulpIf(data.pages, function() {
  10. for (i = 0, i < pages, i++) {
  11. .pipe(nunjucksRender({
  12. path: ['./build/nunjucks/templates']
  13. }));
  14. .pipe(gulp.dest('./build'));
  15. data.number++;
  16. }
  17. }))
  18. // need a for loop here
  19. .pipe(nunjucksRender({
  20. path: ['./build/nunjucks/templates']
  21. }))
  22. .pipe(gulp.dest('./build'));
  23. });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement