-
Notifications
You must be signed in to change notification settings - Fork 0
/
gruntfile.js
57 lines (51 loc) · 1.53 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
// Gruntfile with the configuration of grunt-express and grunt-open. No livereload yet!
module.exports = function(grunt) {
// Load Grunt tasks declared in the package.json file
require('matchdep').filterDev('grunt-*').forEach(grunt.loadNpmTasks);
// Configure Grunt
grunt.initConfig({
//grunt-contrib-compass to compile scss file to dist files
compass: { // Task
dist: { // Target
options: { // Target options
sassDir: '_sass',
cssDir: 'css',
environment: 'production'
}
}
},
shell: {
jekyllServe:{
command: "jekyll serve --baseurl ''"
},
jekyllBuild:{
command: 'jekyll build --config _config-dev.yml'
}
},
//grunt-watch will monitor the project files
watch: {
options:{
livereload: true
},
site: {
files: ['**/*.html', 'index.html', '**/*.md', '!_site/**/*'],
tasks: ['shell:jekyllBuild'],
},
css: {
files: ['_sass/*.scss', '!_site/**/*'],
tasks: ['compass', 'shell:jekyllBuild'],
}
},
// grunt-open will open your browser at the project's URL
open: {
all: {
// Gets the port from the connect configuration
path: 'http://localhost:4000/index.html'
}
}
});
// Creates the `server` task
grunt.registerTask('serve', ['shell:jekyllServe']);
//Compile scss task
grunt.registerTask('default', ['compass', 'shell:jekyllBuild','open', 'watch']);
};