Skip to content
This repository was archived by the owner on Jan 19, 2025. It is now read-only.

Commit e58af1d

Browse files
committed
Added new command to start script to update images without rebuilding the entire website 🚀
1 parent d04daf9 commit e58af1d

File tree

3 files changed

+13
-8
lines changed

3 files changed

+13
-8
lines changed

_scripts/start.sh

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,9 @@
33
# Clean previous build
44
rm -Rf _site/
55

6+
# Copy images, to eventually add new ones for new posts
7+
npm run images
8+
69
# Run pages-gem with bundler.
710
# Add the parameter
811
# --host=0.0.0.0

gulpfile.babel.js

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -79,14 +79,6 @@ const copyFiles = (folder) => {
7979
}
8080
const fonts = () => copyFiles('fonts')
8181
const models = () => copyFiles('models')
82-
export const images = () => {
83-
const destination = 'assets/images'
84-
return gulp
85-
.src([`_images/**/*.*`])
86-
.pipe(gulpChanged(destination))
87-
.pipe(production(gulpImagemin()))
88-
.pipe(gulp.dest(destination))
89-
}
9082

9183
const criticalCss = (src, dest, css) => (
9284
critical.generate({
@@ -175,6 +167,15 @@ const serviceWorkerUrls = (done) => Promise.all([
175167

176168
const jekyllBuild = (done) => exec(`./_scripts/build.sh`, (err, stdout, stderr) => done())
177169

170+
export const images = () => {
171+
const destination = 'assets/images'
172+
return gulp
173+
.src([`_images/**/*.*`])
174+
.pipe(gulpChanged(destination))
175+
.pipe(production(gulpImagemin()))
176+
.pipe(gulp.dest(destination))
177+
}
178+
178179
export const watchCss = () => gulp.watch(`${CSS_FOLDER}/*.scss`, gulp.series(
179180
bundleCss,
180181
jekyllBuild, //First build for critical/purge css

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
"build": "gulp build --env production",
1010
"debug": "gulp build --env development",
1111
"watch-css": "gulp watchCss --env production",
12+
"images": "gulp images --env production",
1213
"start": "_scripts/start.sh",
1314
"test": "_scripts/test.sh",
1415
"version": "_scripts/version.sh",

0 commit comments

Comments
 (0)