-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathGruntfile.js
122 lines (116 loc) · 3.49 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
module.exports = function(grunt) {
// Project configuration.
grunt.initConfig({
compass: {
options: {
sassDir: 'src/assets/sass',
imagesDir: 'src/img',
cssDir: 'web/assets/css',
force: true
},
dist: {
options: {
environment: 'production',
noLineComments: true
}
},
dev: {
options: {
noLineComments: true
}
},
watch: {
options: {
noLineComments: true,
watch: true
}
}
},
assemble: {
options: {
layoutdir: 'src/templates/layouts',
layout: ['default.hbs'],
partials: ['src/templates/partials/{,*/}*.*', 'src/sprites/svg/*'],
helpers: ['partial'],
flatten: true
},
en: {
options: {
data: ['src/templates/data/en/*.yml']
},
src: ['src/templates/pages/en/*.hbs'],
dest: './web'
},
lt: {
options: {
data: ['src/templates/data/lt/*.yml']
},
src: ['src/templates/pages/lt/*.hbs'],
dest: './web/lt/'
},
},
svg_sprite: {
generate: {
cwd: 'web/assets/vendor/material-design-icons',
src: [
'../../../../web/assets/images/ic_menu_24px.svg',
'../../../../web/assets/images/ic_cropfree_24px.svg',
'../../../../web/assets/images/ic_more_24px.svg',
'../../../../web/assets/images/ic_notification_24px.svg',
'../../../../web/assets/images/ic_home_24px.svg',
'../../../../web/assets/images/ic_cloud_24px.svg',
'../../../../web/assets/images/ic_monetization_24px.svg',
'../../../../web/assets/images/ic_char_24px.svg',
'../../../../web/assets/images/ic_favorite_24px.svg',
'../../../../web/assets/images/ic_facebook_24px.svg',
'../../../../web/assets/images/ic_skype_24px.svg',
'../../../../web/assets/images/ic_twitter_24px.svg',
],
dest: 'src/sprites',
options: {
shape: {
id: {
generator: function(filename) {
var id = filename.match(/ic_(\w+)_\d+/);
return id[1];
}
},
},
mode: {
symbol: {
dest: ''
}
}
}
}
},
watch: {
options: {
},
dev: {
files: ['src/assets/sass/**/*.scss', 'src/templates/**/*.hbs'],
tasks: ['compass:dev', 'assemble:site']
},
handlebars: {
files: ['src/templates/*/*.hbs', 'src/templates/layouts/*.hbs' ],
tasks: ['assemble:site']
}
},
});
[
'grunt-contrib-compass',
'grunt-contrib-watch',
'grunt-assemble',
'grunt-svg-sprite'
].forEach(grunt.loadNpmTasks);
grunt.registerTask('assemble:site', [
'assemble:en',
'assemble:lt',
]);
// Default task(s).
grunt.registerTask('default', [
'compass:dist',
'assemble:en',
'assemble:lt',
]);
};