-
Notifications
You must be signed in to change notification settings - Fork 0
/
Gruntfile.js
103 lines (100 loc) · 2.52 KB
/
Gruntfile.js
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
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
module.exports = function(grunt) {
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
sass: {
dist: {
files: {
'_site/css/main.css': '_assets/css/main.scss',
'_site/css/about.css': '_assets/css/about.scss'
}
}
},
autoprefixer: {
dist: {
files: {
'_site/css/main.css': '_site/css/main.css',
'_site/css/about.css': '_site/css/about.css'
}
}
},
cssmin: {
dist: {
options: {
'keepSpecialComments': 0
},
files: {
'_site/css/main.min.css': '_site/css/main.css',
'_site/css/about.min.css': '_site/css/about.css'
}
}
},
uglify: {
options: {
},
dist: {
files: {
'_site/js/main.min.js': ['_assets/js/jscroll.js', '_assets/js/jekyll-search.js', '_assets/js/twitter-fetch.js', '_assets/js/scrolly.js', '_assets/js/main.js']
}
}
},
jekyll: {
dev: {
options: {
src: '.',
dest: '_site',
config: '_config.yml,_config-dev.yml'
}
},
prod: {
options: {
src: '.',
dest: '_site',
config: '_config.yml'
}
}
},
watch: {
markup: {
files: ['index.html', '_includes/*.html', '_layouts/*.html', '_posts/**/*', 'about/index.html'],
tasks: ['jekyll:dev'],
options: {
livereload: true
}
},
css: {
files: ['_assets/css/*.scss', '_assets/css/**/*.scss'],
tasks: ['sass', 'autoprefixer', 'cssmin'],
options: {
livereload: true
}
},
js: {
files: ['_assets/js/*.js', '_assets/js/**/*.js'],
tasks: ['uglify'],
options: {
livereload: true
}
}
},
connect: {
server: {
options: {
port: 2000,
hostname: 'localhost',
base: '_site'
}
}
}
});
//load npm tasks
grunt.loadNpmTasks('grunt-contrib-sass');
grunt.loadNpmTasks('grunt-contrib-watch');
grunt.loadNpmTasks('grunt-contrib-uglify');
grunt.loadNpmTasks('grunt-contrib-cssmin');
grunt.loadNpmTasks('grunt-autoprefixer');
grunt.loadNpmTasks('grunt-jekyll');
grunt.loadNpmTasks('grunt-contrib-connect');
grunt.registerTask('default', ['sass', 'autoprefixer', 'cssmin', 'uglify']);
grunt.registerTask('serve', ['connect', 'default', 'jekyll:dev', 'watch']);
grunt.registerTask('prod', ['default', 'jekyll:prod'])
};