/
Gruntfile.js
63 lines (57 loc) · 1.56 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
var path = require("path");
var FEATURED = require("./featured.json");
module.exports = function (grunt) {
// Load NPM tasks
grunt.loadNpmTasks('grunt-contrib-less');
grunt.loadNpmTasks('grunt-swig');
grunt.loadNpmTasks('grunt-gh-pages');
// Init GRUNT configuraton
grunt.initConfig({
'pkg': grunt.file.readJSON('package.json'),
'less': {
development: {
options: {
compress: true,
yuicompress: true,
optimization: 2
},
files: {
"www/static/style.css": "stylesheets/main.less"
}
}
},
'swig': {
development: {
init: {
autoescape: true
},
dest: "www/",
src: ['templates/*.swig'],
generateSitemap: true,
generateRobotstxt: true,
siteUrl: 'http://www.gitbook.io',
production: true,
ga_account_id: 'UA-xxxxxxxx-1',
example: "http://gitbookio.github.io/javascript/",
featured: FEATURED
}
},
'gh-pages': {
options: {
base: 'www'
},
src: ['**']
}
});
// Build
grunt.registerTask('build', [
'less',
'swig'
]);
grunt.registerTask('publish', [
'gh-pages'
]);
grunt.registerTask('default', [
'build'
]);
};