forked from OWASP/owasp-summit-2017
-
Notifications
You must be signed in to change notification settings - Fork 0
/
gulpfile.coffee
61 lines (47 loc) · 2.51 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
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 '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 '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'],->
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 'Logistics/**/*.md' , ['reload-page']
gulp.watch 'Participants/**/*.md' , ['reload-page']
gulp.watch 'Working-Sessions/**/*.md' , ['reload-page']