-
Notifications
You must be signed in to change notification settings - Fork 382
/
Gruntfile.js
155 lines (135 loc) · 3.15 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
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
// Generated on 2014-01-19 using generator-jekyllrb 1.2.1
'use strict';
// Directory reference:
// css: assets/css
// sass: assets/_scss
// javascript: assets/js
// images: assets/img
// fonts: assets/fonts
module.exports = function (grunt) {
// Show elapsed time after tasks run
require('time-grunt')(grunt);
// Load all Grunt tasks
require('load-grunt-tasks')(grunt);
grunt.initConfig({
// Configurable paths
yeoman: {
app: 'app',
dist: 'dist'
},
livestyle: {
root: '.tmp',
browsers: ['last 2 versions'],
// Watch HTML-files and livereload on changes
watchHtml: true,
// Watch CSS background images and livereload on changes
watchCssImages: false,
// Run each image through the image processing pipeline exposed by express-processimage
// Allows you to resize, recompress, change image format, rasterize SVG and much more
// Reading the documentation is highly recommended: https://github.com/papandreou/express-processimage#express-processimage
processimage: true,
},
clean: {
dist: {
files: [{
dot: true,
src: [
'<%= yeoman.dist %>/*',
// Running Jekyll also cleans the target directory. Exclude any
// non-standard `keep_files` here (e.g., the generated files
// directory from Jekyll Picture Tag).
'!<%= yeoman.dist %>/.git*'
]
}]
},
server: [
'.tmp'
]
},
jekyll: {
options: {
bundleExec: true,
config: '_config.yml,_config.build.yml',
src: '<%= yeoman.app %>'
},
dist: {},
serve: {
options: {
config: '_config.yml',
watch: true
}
},
check: {
options: {
doctor: true,
src: './'
}
}
},
reduce: {
root: '.tmp',
outroot: '<%= yeoman.dist %>',
include: [
'index.html',
'404.html',
'migrate.html',
'*/**/*.html',
'CNAME',
'_redirects'
],
browsers: [
'last 2 versions'
]
},
jshint: {
options: {
jshintrc: '.jshintrc',
reporter: require('jshint-stylish')
},
all: [
'Gruntfile.js',
'<%= yeoman.app %>/assets/js/**/*.js',
'!<%= yeoman.app %>/assets/js/libs/*.js'
]
},
csslint: {
options: {
csslintrc: '.csslintrc'
},
check: {
src: [
'<%= yeoman.app %>/assets/css/**/*.css'
]
}
},
concurrent: {
server: {
tasks: [
'livestyle',
'jekyll:serve'
],
logConcurrentOutput: true
}
}
});
// Define Tasks
grunt.registerTask('serve', [
'concurrent:server'
]);
grunt.registerTask('check', [
'clean:server',
'jekyll:check',
'jshint:all',
'csslint:check'
]);
grunt.registerTask('build', [
'clean',
// Jekyll cleans files from the target directory, so must run first
'jekyll:dist',
'reduce'
]);
grunt.registerTask('default', [
'check',
'build'
]);
};