Shrimadhav U K

add edit sequence error

......@@ -7,5 +7,9 @@ pages:
artifacts:
paths:
- public
cache:
paths:
- node_modules
key: project
only:
- master
......
......@@ -11,6 +11,7 @@ var connect = require('gulp-connect');
var connectProxy = require('gulp-connect-proxy');
var yamlinc = require("gulp-yaml-include");
var runSequence = require('run-sequence');
var readYaml = require('read-yaml');
var glob = require("glob");
......@@ -46,7 +47,7 @@ gulp.task('jslint', function() {
.pipe(jshint.reporter('default'));
});
gulp.task('pughtml', function() {
gulp.task('GenerateIndexPage', function(){
gulp.src('pug/pages/*.pug')
.pipe(pug({
pretty: true,
......@@ -55,48 +56,54 @@ gulp.task('pughtml', function() {
}
}))
.pipe(gulp.dest('public'));
var yamlData = gulp.src("events/index.yaml")
});
gulp.task('GenerateEventsYAML', function(){
return gulp.src("events/index.yaml")
.pipe(yamlinc())
.pipe(gulp.dest('public/events'));
})
gulp.task('GenerateEventsPage', function(){
readYaml('public/events/index.yaml', function(err, ydata) {
if (err) throw err;
gulp.src('pug/templates/events.pug')
.pipe(pug({
pretty: true,
data: {
debug: true,
events: ydata
}
}))
.pipe(concat('index' + '.html'))
.pipe(gulp.dest('public/events'));
});
glob("events/TheRealEvents/*.yaml", {}, function (er, files) {
var nooffiles = files.length;
for(var i = 0; i < nooffiles; i++){
readYaml(files[i], function(err, ydata) {
if (err) throw err;
var id = ydata.id;
gulp.src('pug/templates/individual_event_page.pug')
.pipe(pug({
pretty: true,
data: {
debug: true,
evt: ydata
}
}))
.pipe(concat(id + '.html'))
.pipe(gulp.dest('public/events'));
});
}
});
})
readYaml('public/events/index.yaml', function(err, ydata) {
// if (err) throw err;
gulp.src('pug/templates/events.pug')
.pipe(pug({
pretty: true,
data: {
debug: true,
events: ydata
}
}))
.pipe(concat('index' + '.html'))
.pipe(gulp.dest('public/events'));
});
// options is optional
glob("events/TheRealEvents/*.yaml", {}, function (er, files) {
// files is an array of filenames.
// If the `nonull` option is set, and nothing
// was found, then files is ["**/*.js"]
// er is an error object or null.
var nooffiles = files.length;
for(var i = 0; i < nooffiles; i++){
readYaml(files[i], function(err, ydata) {
if (err) throw err;
var id = ydata.id;
gulp.src('pug/templates/individual_event_page.pug')
.pipe(pug({
pretty: true,
data: {
debug: true,
evt: ydata
}
}))
.pipe(concat(id + '.html'))
.pipe(gulp.dest('public/events'));
});
}
});
gulp.task('pughtml', function(){
runSequence('GenerateEventsYAML',[
'GenerateIndexPage',
'GenerateEventsPage'
])
});
gulp.task('cssmin', function() {
......
......@@ -24,7 +24,8 @@
"gulp-uglify": "^3.0.0",
"gulp-yaml-data": "^0.2.0",
"gulp-yaml-include": "^0.2.0",
"read-yaml": "^1.1.0"
"read-yaml": "^1.1.0",
"run-sequence": "^1.2.2"
},
"dependencies": {
"Respond.js": "git+https://github.com/scottjehl/Respond.git#1.4.0",
......