Skip to content
This repository has been archived by the owner on Jun 18, 2021. It is now read-only.

Commit

Permalink
Remove lazyload Gulp task
Browse files Browse the repository at this point in the history
  • Loading branch information
mmistakes committed Feb 15, 2019
1 parent d710e74 commit d60302c
Show file tree
Hide file tree
Showing 7 changed files with 6 additions and 63 deletions.
6 changes: 0 additions & 6 deletions README.md
Expand Up @@ -285,12 +285,6 @@ settings.
Optimizes standard images and copies to `/dist` folder.

> `gulp images:lazyload`
Creates a "low-quality" version of all images in `src/assets/images/lazyload`
for lazyloading and copies it and the original to `/dist` folder after being
optimized.

> `gulp images:feature`
Similar to the previous task but for images in `src/assets/images/feature`.
Expand Down
2 changes: 1 addition & 1 deletion gulp/tasks/assets.js
Expand Up @@ -199,6 +199,6 @@ gulp.task("serve", done => {
gulp.watch(paths.sassFilesGlob, gulp.series("styles", reload));
gulp.watch(
paths.imageFilesGlob,
gulp.series("copy:images", "images:lazyload", "images:feature", reload)
gulp.series("copy:images", "images:feature", reload)
);
});
5 changes: 3 additions & 2 deletions gulp/tasks/copy.js
Expand Up @@ -5,6 +5,7 @@ var newer = require("gulp-newer");
// include paths file
var paths = require("../paths");

// 'gulp copy:assets' -- copies assets to /dist/
// to avoid Jekyll overwriting the whole directory
gulp.task("copy:assets", () => {
return gulp
Expand All @@ -17,8 +18,8 @@ gulp.task("copy:images", () => {
return gulp
.src([
paths.imageFilesGlob,
"!src/assets/images/{feature,feature/**,lazyload,lazyload/**}"
]) // do not process feature/lazyload images
"!src/assets/images/{feature,feature/**}"
]) // do not process feature images
.pipe(newer(paths.imageFilesSite))
.pipe(gulp.dest(paths.imageFilesSite));
});
Expand Down
15 changes: 0 additions & 15 deletions gulp/tasks/copy.js.rej

This file was deleted.

38 changes: 1 addition & 37 deletions gulp/tasks/images.js
Expand Up @@ -13,7 +13,7 @@ gulp.task("images:optimize", () => {
return gulp
.src([
paths.imageFilesGlob,
"!src/assets/images/{feature,feature/**,lazyload,lazyload/**}"
"!src/assets/images/{feature,feature/**}"
]) // do not process feature images
.pipe(newer(paths.imageFilesSite))
.pipe(
Expand All @@ -31,42 +31,6 @@ gulp.task("images:optimize", () => {
.pipe(size({ title: "images" }));
});

// 'gulp images:lazyload' -- resize and optimize lazyload images
gulp.task("images:lazyload", () => {
return gulp
.src([
paths.imageFiles + "/lazyload" + paths.imagePattern,
"!" + paths.imageFiles + "/lazyload/**/*.{gif,svg}"
])
.pipe(assetCache.filter(paths.imageFilesCachePath + '/.lazyload-image-cache'))
.pipe(
responsive(
{
// resize all images
"*.*": [
{
width: 20,
rename: { suffix: "-lq" }
},
{
// copy original image
width: "100%",
rename: { suffix: "" }
}
]
},
{
// global configuration for all images
errorOnEnlargement: false,
withMetadata: false,
errorOnUnusedConfig: false
}
)
)
.pipe(gulp.dest(paths.imageFilesCachePath)) // write to cache
.pipe(assetCache.cache());
});

// 'gulp images:feature' -- resize images
gulp.task("images:feature", () => {
return gulp
Expand Down
1 change: 0 additions & 1 deletion gulpfile.js
Expand Up @@ -19,7 +19,6 @@ gulp.task(
gulp.series(
"scripts:gzip",
"styles:gzip",
"images:lazyload",
"images:feature",
"copy:assets",
"copy:images:cached",
Expand Down
2 changes: 1 addition & 1 deletion src/assets/images

0 comments on commit d60302c

Please sign in to comment.