Skip to content

Commit acb873a

Browse files
Ivan MamenemunoIvan Mamenemuno
authored andcommitted
Add all files to repo
0 parents  commit acb873a

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

42 files changed

+1220
-0
lines changed

Gruntfile.js

Lines changed: 95 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,95 @@
1+
/*
2+
After you have changed any settings for the responsive_images task,
3+
run this with one of these options:
4+
"grunt" alone creates a new, completed images directory
5+
"grunt clean" removes the images directory
6+
"grunt responsive_images" re-processes images without removing the old ones
7+
*/
8+
9+
module.exports = function(grunt) {
10+
11+
grunt.initConfig({
12+
svgmin: {
13+
options: {
14+
plugins: [
15+
{
16+
removeViewBox: false
17+
}, {
18+
removeUselessStrokeAndFill: false
19+
}, {
20+
removeAttrs: {
21+
attrs: ['xmlns']
22+
}
23+
}
24+
]
25+
},
26+
dist: {
27+
files: [{
28+
expand: true,
29+
src: ['*.svg'],
30+
cwd: 'imgs/',
31+
dest: 'imgs/build/'
32+
}]
33+
}
34+
},
35+
responsive_images: {
36+
dev: {
37+
options: {
38+
sizes: [{
39+
width: 1600,
40+
suffix: '_large_2x',
41+
quality: 30
42+
},{
43+
/* Change these */
44+
width: 800,
45+
suffix: '_Medium_1x',
46+
quality: 30
47+
}]
48+
},
49+
files: [{
50+
expand: true,
51+
src: ['*.{gif,jpg,png}'],
52+
cwd: 'images_src/',
53+
dest: 'images/'
54+
}]
55+
}
56+
},
57+
58+
/* Clear out the images directory if it exists */
59+
clean: {
60+
dev: {
61+
src: ['images'],
62+
},
63+
},
64+
65+
/* Generate the images directory if it is missing */
66+
mkdir: {
67+
dev: {
68+
options: {
69+
create: ['images']
70+
},
71+
},
72+
},
73+
74+
/* Copy the "fixed" images that don't go through processing into the images/directory */
75+
copy: {
76+
dev: {
77+
files: [{
78+
expand: true,
79+
src: ['images_src/fixed/*.{gif,jpg,png}'],
80+
dest: 'images/',
81+
flatten: true,
82+
}]
83+
},
84+
},
85+
86+
});
87+
88+
grunt.loadNpmTasks('grunt-responsive-images');
89+
grunt.loadNpmTasks('grunt-contrib-clean');
90+
grunt.loadNpmTasks('grunt-contrib-copy');
91+
grunt.loadNpmTasks('grunt-mkdir');
92+
grunt.loadNpmTasks('grunt-svgmin');
93+
grunt.registerTask('default', ['clean', 'mkdir', 'copy', 'responsive_images']);
94+
95+
};

0 commit comments

Comments
 (0)