Skip to content

Commit

Permalink
Merge pull request #9 from donini/1.2.0
Browse files Browse the repository at this point in the history
Closing v 1.2.0
  • Loading branch information
donini committed Oct 15, 2016
2 parents e0c81dc + 82d043b commit c0b2639
Show file tree
Hide file tree
Showing 5 changed files with 38 additions and 9 deletions.
10 changes: 10 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
## Changelog ##

#### v1.2.0 - 14/10/2016 ####
- Move images dir to assets dir #7
- Add task to image minification in Grunt.js file #6
- Correct prompt item name on menu #8

#### v1.1.0 - 9/9/2016 ####
- Change docs
- Correct some strings
Binary file modified DONFramework.zip
Binary file not shown.
32 changes: 24 additions & 8 deletions Gruntfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -134,9 +134,9 @@ module.exports = function( grunt ) {
// GENERATE SPRITES
sprites: {
theme: {
src: ['source/wp-content/themes/<%= pkg.name %>/images/src/*.png'],
src: ['source/wp-content/themes/<%= pkg.name %>/assets/images/src/*.png'],
css: 'source/wp-content/themes/<%= pkg.name %>/assets/css/sass/_don_child_sprite.scss',
map: 'source/wp-content/themes/<%= pkg.name %>/images/don_child_sprite.png'
map: 'source/wp-content/themes/<%= pkg.name %>/assets/images/don_child_sprite.png'
}
},
// COMPILE SASS
Expand Down Expand Up @@ -278,14 +278,14 @@ module.exports = function( grunt ) {
}
},
imagesDon:{
files: ['source/wp-content/themes/DONFramework/images/src/*.png'],
files: ['source/wp-content/themes/DONFramework/assets/images/src/*.png'],
tasks: ['sprites:don'],
options:{
livereload: true
}
},
imagesTheme:{
files: ['source/wp-content/themes/<%= pkg.name %>/images/src/*.png'],
files: ['source/wp-content/themes/<%= pkg.name %>/assets/images/src/*.png'],
tasks: ['sprites:theme'],
options:{
livereload: true
Expand All @@ -298,6 +298,22 @@ module.exports = function( grunt ) {
]
}
},
// IMAGE OPTIMIZATION
imagemin: {
dist: {
options: {
optimizationLevel: 7,
progressive: true
},
files: [{
expand: true,
filter: 'isFile',
cwd: 'source/wp-content/themes/<%= pkg.name %>/assets/images/',
src: '**/*.{png,jpg,gif}',
dest: 'source/wp-content/themes/<%= pkg.name %>/assets/images/'
}]
}
},
// CLEAN TEMP FILES
clean: {
preDeploy: {
Expand All @@ -309,7 +325,7 @@ module.exports = function( grunt ) {
'build/files/wp-content/themes/<%= pkg.name %>/assets/css/sass',
'build/files/wp-content/themes/<%= pkg.name %>/assets/js/src',
'build/files/wp-content/themes/<%= pkg.name %>/assets/js/vendor',
'build/files/wp-content/themes/<%= pkg.name %>/images/src',
'build/files/wp-content/themes/<%= pkg.name %>/assets/images/src',
'build/**/*md'
]
},
Expand Down Expand Up @@ -359,7 +375,7 @@ module.exports = function( grunt ) {
},
{
value: 'watch',
name: '8) Watch for file changes'
name: '9) Watch for file changes'
},
{
value: 'exit',
Expand Down Expand Up @@ -638,10 +654,10 @@ module.exports = function( grunt ) {

// BUILD ALL ASSETS
grunt.registerTask('buildAssets', function(){
var tasks = ['sprites', 'buildStyle', 'buildScript'];
var tasks = ['sprites', 'buildStyle', 'buildScript', 'imagemin'];
grunt.task.run(tasks);
}).registerTask('ba', function(){
var tasks = ['sprites', 'buildStyle', 'buildScript'];
var tasks = ['sprites', 'buildStyle', 'buildScript', 'imagemin'];
grunt.task.run(tasks);
});

Expand Down
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ grunt create [OR] grunt c

### 6) Build Assets

To build all styles<sup>2</sup>, javascript and create sprite file, type this:
To build all styles<sup>2</sup>, javascript, minify images and create sprite file, type this:

```shell
grunt buildAssets [OR] grunt ba
Expand Down Expand Up @@ -211,3 +211,5 @@ grunt watch [OR] grunt w
## Suggest new features and register issues

Use the Issues menu of this repository to register issues, doubts and suggest new features.

See [changelog](./CHANGELOG.md) of project.
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
"grunt-contrib-connect": "*",
"grunt-contrib-copy": "*",
"grunt-contrib-cssmin": "*",
"grunt-contrib-imagemin": "*",
"grunt-contrib-jshint": "*",
"grunt-contrib-nodeunit": "*",
"grunt-contrib-sass": "*",
Expand Down

0 comments on commit c0b2639

Please sign in to comment.