-
Notifications
You must be signed in to change notification settings - Fork 0
/
gulpfile.coffee
58 lines (48 loc) · 1.55 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
gulp = require 'gulp'
del = require 'del'
stylus = require 'gulp-stylus'
bootstrap = require 'bootstrap-styl'
jade = require 'gulp-jade'
stream = require 'combined-stream'
concat = require 'gulp-concat'
coffee = require 'gulp-coffee'
marked = require 'marked'
_ = require 'lodash'
helpers = require './_lib/helpers'
paths =
js: [
'node_modules/jquery/dist/jquery.min.js'
]
gulp.task 'clean:js', (cb) ->
del 'assets/site.js', cb
gulp.task 'clean:css', (cb) ->
del 'assets/site.css', cb
gulp.task 'clean:views', (cb) ->
del '*.html', cb
gulp.task 'js', ['clean:js'], ->
s = stream.create()
s.append gulp.src ['_scripts/*.js'].concat(paths.js)
s.append gulp.src('_scripts/site.coffee').pipe(coffee().on('error', console.log))
s
.pipe concat('site.js')
.pipe gulp.dest('assets')
gulp.task 'css', ['clean:css'], ->
s = stream.create()
s.append gulp.src('_styles/*.css')
s.append gulp.src('_styles/site.styl').pipe(stylus(use: bootstrap()).on('error', console.log))
s
.pipe concat('site.css')
.pipe gulp.dest('assets')
gulp.task 'views', ['clean:views'], ->
delete require.cache[__dirname + "/_views/data.coffee"];
data = _.assign {}, require('./_views/data'), helpers,
marked: marked
_: _
gulp.src('_views/index.jade')
.pipe jade(pretty: true, data: data).on('error', console.log)
.pipe gulp.dest('.')
gulp.task 'watch', ['default'], ->
gulp.watch ['_scripts/**/*'].concat(paths.js), ['js']
gulp.watch '_styles/**/*', ['css']
gulp.watch '_views/**/*', ['views']
gulp.task 'default', ['js', 'css', 'views']