This repository has been archived by the owner on Nov 14, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 219
/
gulpfile.coffee
81 lines (62 loc) · 3.28 KB
/
gulpfile.coffee
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
require 'fluentnode'
browserSync = require('browser-sync').create();
gulp = require 'gulp'
concat = require 'gulp-concat'
pug = require 'gulp-jade'
less = require 'gulp-less'
notify = require 'gulp-notify'
shell = require 'gulp-shell'
gulp.task 'build', [], shell.task(['jekyll build --incremental'])
gulp.task 'build-all', [], shell.task(['jekyll build'])
gulp.task 'build-data', [], shell.task(['npm run build-data'])
#gulp.task 'npm-tests', [], (done)->
# console.log "starting npm"
# 'npm'.start_Process_Redirect_Console 'test'
# .on 'exit', ()->
# console.log "----- npm finished"
# 'jekyll'.start_Process_Redirect_Console 'clean'
# .on 'exit', ()->
# console.log "----- all done"
# done()
gulp.task 'pug', ()->
localsObject = {}
pug_Compile = (source_Folder, target_Folder)=>
gulp.src(source_Folder)
.pipe(pug( locals: localsObject, pretty: true))
.on('error', notify.onError(message: 'Pug compile error: <%= error.message %>'))
.pipe(gulp.dest(target_Folder))
pug_Compile('src/includes/**/*.pug', 'website/_includes')
pug_Compile('src/layouts/**/*.pug' , 'website/_layouts')
gulp.task 'reload-page' , ['build'], -> browserSync.reload()
gulp.task 'reload-page-all', ['build-all'], -> browserSync.reload()
gulp.task 'styles', ->
gulp.src('src/less/**/*.less')
.pipe(less())
.on('error', notify.onError(message: 'LESS compile error: <%= error.message %>'))
.pipe(concat('blocks.css'))
.pipe(gulp.dest('website/assets/css'))
#.pipe browserSync.reload(stream: true) # this is not working
gulp.task 'default' , ['styles', 'pug', 'build-data', 'build'],->
browserSync.init
online : false # doesn't bind to public IP address
port : 9000 # site will be available at http://localhost:9000/
open : false # use to not open a new browser window every time we start gulp
logConnections : true
#logLevel : 'debug'
startPath : '/website/' # first page that loads up
server : baseDir: '_site/'
# gulp.watch 'new/**/*.md' , ['reload-page']
gulp.watch '_posts/**/*.md' , ['reload-page']
gulp.watch 'schedule/**/*.md' , ['reload-page']
gulp.watch 'pages/**/*.md' , ['reload-page']
gulp.watch 'website/**/*.md' , ['reload-page']
gulp.watch 'website/_data/**/*' , ['reload-page']
gulp.watch 'website/**/*.html' , ['reload-page']
gulp.watch 'website/assets/css/**/*.css' , ['reload-page']
gulp.watch 'src/less/**/*.less' , ['styles' ]
gulp.watch 'src/**/*.pug' , ['pug' ]
gulp.watch 'src/**/*.jade' , ['pug' ]
gulp.watch 'Logistics/**/*.md' , ['build-data', 'reload-page-all']
gulp.watch 'Participants/**/*.md' , ['build-data', 'reload-page-all']
gulp.watch 'Working-Sessions/**/*.md' , ['build-data', 'reload-page-all']
gulp.watch 'Outcomes/**/*.md' , ['reload-page']