-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
b617540
commit afa22da
Showing
5 changed files
with
225 additions
and
216 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
#!/bin/bash | ||
# shellcheck disable=SC2154 | ||
# shellcheck disable=SC2086 | ||
|
||
|
||
function browsersyncReload() { | ||
log "π BROWSERSYNC reload" | ||
./node_modules/.bin/browser-sync \ | ||
reload \ | ||
--url http://${npm_package_config_url}:${npm_package_config_browsersync_port} | ||
} | ||
|
||
function browsersyncStart() { | ||
log "π¬ BROWSERSYNC start" | ||
./node_modules/.bin/browser-sync \ | ||
start \ | ||
-c ./browsersync.json \ | ||
--server ./serve \ | ||
--port "${npm_package_config_browsersync_port}" \ | ||
--ui-port "${npm_package_config_browsersync_uiport}" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
#!/bin/bash | ||
# shellcheck disable=SC2154 | ||
# shellcheck disable=SC2086 | ||
|
||
function imgBuild() { | ||
imgOptimize | ||
imgMakeWebp | ||
imgCopyToJekyll | ||
} | ||
|
||
function imgOptimize() { | ||
mkdir ./assets/img/optimized/ | ||
log "ποΈ IMG optimize JPG" | ||
# JPG | ||
./node_modules/.bin/imagemin \ | ||
./assets/img/original/**.{jpg,jpeg} \ | ||
--out-dir=./assets/img/optimized/ | ||
|
||
# SVG | ||
log "ποΈ IMG optimize SVG" | ||
./node_modules/.bin/imagemin \ | ||
./assets/img/original/**.svg \ | ||
--plugin=svgo \ | ||
--out-dir=./assets/img/optimized/ | ||
|
||
# PNG | ||
log "π IMG optimize PNG" | ||
./node_modules/.bin/imagemin \ | ||
./assets/img/original/**.png \ | ||
--plugin=pngcrush \ | ||
--out-dir=./assets/img/optimized/ | ||
} | ||
|
||
function imgMakeWebp() { | ||
if [ "$npm_package_config_img_webp_active" = "true" ]; then | ||
log "ποΈ IMG make WebP" | ||
./node_modules/.bin/imagemin \ | ||
./assets/img/original/**.{jpg,jpeg} \ | ||
--plugin=webp \ | ||
--out-dir=./assets/img/optimized/ | ||
else | ||
log "ποΈ (IMG make WebP deactivated)" | ||
fi | ||
} | ||
|
||
function imgCopyToJekyll() { | ||
log "ποΈ IMG copy to jekyll" | ||
mkdir ./jekyll/assets/img | ||
cp ./assets/img/optimized/**.* ./jekyll/assets/img | ||
} | ||
|
||
function imgWatch() { | ||
log "π³ IMG watch" | ||
./node_modules/.bin/nodemon \ | ||
-e jpeg,jpg,png,svg,gif \ | ||
--watch assets/img/original \ | ||
-x "./bin/img-build.sh" | ||
} | ||
|
||
function imgCleanup() { | ||
log "ποΈ IMG Clean-Up" | ||
rm -r ./assets/img/optimized/* | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
#!/bin/bash | ||
# shellcheck disable=SC2154 | ||
# shellcheck disable=SC2086 | ||
|
||
function jekyllBuildDist() { | ||
log "ποΈ JEKYLL build [DIST]" | ||
bundle exec \ | ||
jekyll build \ | ||
--config jekyll_config_base.yml,jekyll_config_dist.yml | ||
} | ||
|
||
function jekyllBuildNetlify() { | ||
log "ποΈ JEKYLL build [NETLIFY]" | ||
bundle exec \ | ||
jekyll build \ | ||
--config jekyll_config_base.yml,jekyll_config_netlify.yml | ||
} | ||
|
||
function jekyllBuildDev() { | ||
log "ποΈ JEKYLL build [DEV]" | ||
bundle exec \ | ||
jekyll build \ | ||
--config jekyll_config_base.yml | ||
} | ||
|
||
function jekyllCleanup() { | ||
log "ποΈ JEKYLL Clean-Up" | ||
rm -r ./jekyll/assets/img/* | ||
rm -r ./jekyll/assets/css/* | ||
} | ||
|
||
function jekyllWatchDev() { | ||
log "π³ JEKYLL watch" | ||
./node_modules/.bin/nodemon \ | ||
-e md,html,css,js,png,jpg,jpeg,svg \ | ||
--watch jekyll \ | ||
-x "./bin/jekyll-build--dev.sh; ./bin/browsersync-reload.sh;" | ||
} |
Oops, something went wrong.