-
Notifications
You must be signed in to change notification settings - Fork 71
/
Gruntfile.coffee
78 lines (67 loc) · 1.88 KB
/
Gruntfile.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
module.exports = (grunt) ->
grunt.initConfig
# first, clean out everything in the /build folder
clean: ["build"]
# copy some files from /source to /build exactly how they are
copy:
cname:
expand: true
cwd: 'source/'
src: ['CNAME']
dest: 'build/'
images:
expand: true
cwd: 'source/images/'
src: ['**']
dest: 'build/images/'
css:
expand: true
cwd: 'source/styles/'
src: ['**']
dest: 'build/'
js:
expand: true
cwd: 'source/scripts/'
src: ['**']
dest: 'build/'
# compile our html
jade:
run:
expand: true
cwd: 'source/pages/'
src: ['**/*.jade']
dest: 'build/'
ext: '.html'
# start a tiny webserver at localhost:8000
connect:
server:
options:
base: 'build'
open: true # opens your website in the browser immediately
hostname: '0.0.0.0' # lets you access your site from the network, look up your ip addy using "ifconfig" on mac
# when there are any changes, reload the page (requires livereload extension)
watch:
options:
livereload: true
files: ['source/**/*']
tasks: ['clean', 'copy', 'jade']
# deploy to github pages
'gh-pages':
options:
base: 'build'
src: ['**']
grunt.loadNpmTasks('grunt-contrib-clean')
grunt.loadNpmTasks('grunt-contrib-copy')
grunt.loadNpmTasks('grunt-contrib-jade')
grunt.loadNpmTasks('grunt-contrib-connect')
grunt.loadNpmTasks('grunt-contrib-watch')
grunt.loadNpmTasks('grunt-gh-pages')
# compiles the site and sets up a local server
# run this task with "grunt"
grunt.registerTask('default', ['clean', 'copy', 'jade', 'connect', 'watch'])
# compiles the site
# run this task with "grunt build"
grunt.registerTask('build', ['clean', 'copy', 'jade'])
# compiles the site and sends it to Amazon S3 (see readme for directions)
# run this task with "grunt deploy"
grunt.registerTask('deploy', ['build', 'gh-pages'])