Skip to content

Commit 35968dc

Browse files
Merge pull request #13 from CastleCSS/develop
1.4.0
2 parents 3576228 + 2ae7b70 commit 35968dc

File tree

13 files changed

+5868
-1578
lines changed

13 files changed

+5868
-1578
lines changed

Gruntfile.js

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,9 @@ module.exports = function(grunt) {
44
/* Using jit-grunt for automatically loading all required plugins */
55
require('jit-grunt')(grunt);
66

7+
const mozjpeg = require('imagemin-mozjpeg');
8+
const imageminPngcrush = require('imagemin-pngcrush');
9+
710
grunt.initConfig({
811
pkg: grunt.file.readJSON('package.json'),
912

@@ -67,14 +70,57 @@ module.exports = function(grunt) {
6770
options: {
6871
spawn: false,
6972
}
73+
},
74+
75+
imagemin: {
76+
77+
jpg: {
78+
options: {
79+
progressive: true,
80+
use: [
81+
mozjpeg(),
82+
],
83+
cache: false
84+
},
85+
files: [{
86+
expand: true,
87+
cwd: 'img/',
88+
src: ['**/*.{jpg,jpeg}'],
89+
dest: 'dist/img'
90+
}]
91+
},
92+
rest: {
93+
options: {
94+
optimizationLevel: 7, //about optimizationlevel:https://www.npmjs.com/package/grunt-contrib-imagemin#optimizationlevel-png
95+
svgoPlugins: [{
96+
removeComments: true,
97+
cleanupAttrs: true,
98+
removeMetadata: true,
99+
minifyStyles: true,
100+
}],
101+
progressive: true,
102+
plugins: [
103+
imageminPngcrush()
104+
],
105+
cache: false
106+
},
107+
files: [{
108+
expand: true,
109+
cwd: 'img/',
110+
src: ['**/*.{png,gif,svg}'],
111+
dest: 'dist/img'
112+
}]
113+
}
70114
}
115+
71116
})
72117

73118
// Grunt Tasks
74119
// Run these by typing 'grunt' or 'grunt <command>' in your terminal.
75120
grunt.registerTask('default', 'run');
76121
grunt.registerTask('run',
77122
[
123+
'imagemin',
78124
'sass',
79125
'postcss',
80126
'browserSync',
@@ -87,4 +133,9 @@ module.exports = function(grunt) {
87133
'postcss'
88134
]
89135
);
136+
grunt.registerTask('create_img',
137+
[
138+
'imagemin'
139+
]
140+
);
90141
};

about.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
<link rel="stylesheet" href="dist/css/styles.min.css" />
1818

1919
<!-- Favicon -->
20-
<link rel="icon" type="image/png" href="img/favicon.png">
20+
<link rel="icon" type="image/png" href="dist/img/favicon.png">
2121

2222
<!-- Scripts -->
2323
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.2.1/jquery.min.js" type="text/javascript"></script>
@@ -30,7 +30,7 @@
3030
<i class="fa fa-bars"></i>
3131
</a>
3232
<a href="index.html" class="logo">
33-
<img src="img/logo.svg" alt="Company Name Logo" />
33+
<img src="dist/img/logo.svg" alt="Company Name Logo" />
3434
</a>
3535
<ul class="nav">
3636
<li><a href="index.html">Home</a></li>

clean.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
<link rel="stylesheet" href="dist/css/styles.min.css" />
1818

1919
<!-- Favicon -->
20-
<link rel="icon" type="image/png" href="img/favicon.png">
20+
<link rel="icon" type="image/png" href="dist/img/favicon.png">
2121
</head>
2222
<body>
2323
<div class="wrapper">

contact.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
<link rel="stylesheet" href="dist/css/styles.min.css" />
1818

1919
<!-- Favicon -->
20-
<link rel="icon" type="image/png" href="img/favicon.png">
20+
<link rel="icon" type="image/png" href="dist/img/favicon.png">
2121

2222
<!-- Scripts -->
2323
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.2.1/jquery.min.js" type="text/javascript"></script>
@@ -36,7 +36,7 @@
3636
<i class="fa fa-bars"></i>
3737
</a>
3838
<a href="index.html" class="logo">
39-
<img src="img/logo.svg" alt="Company Name Logo" />
39+
<img src="dist/img/logo.svg" alt="Company Name Logo" />
4040
</a>
4141
<ul class="nav">
4242
<li><a href="index.html">Home</a></li>

dist/css/styles.min.css

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/css/styles.min.css.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/img/favicon.png

1.1 KB
Loading

dist/img/logo.png

4.84 KB
Loading

dist/img/logo.svg

Lines changed: 1 addition & 0 deletions
Loading

index.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
<link rel="stylesheet" href="dist/css/styles.min.css" />
1818

1919
<!-- Favicon -->
20-
<link rel="icon" type="image/png" href="img/favicon.png">
20+
<link rel="icon" type="image/png" href="dist/img/favicon.png">
2121

2222
<!-- Scripts -->
2323
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.2.1/jquery.min.js" type="text/javascript"></script>
@@ -34,7 +34,7 @@
3434
<div class="container">
3535
<a class="menu-btn" data-menu-toggle><i class="fa fa-bars"></i></a>
3636
<a href="index.html" class="logo">
37-
<img src="img/logo.svg" alt="Company Name Logo"/>
37+
<img src="dist/img/logo.svg" alt="Company Name Logo"/>
3838
</a>
3939
<ul class="nav">
4040
<li><a href="index.html">Home</a></li>

0 commit comments

Comments
 (0)