summaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile24
1 files changed, 24 insertions, 0 deletions
diff --git a/Makefile b/Makefile
index 77a6ea6..86629ba 100644
--- a/Makefile
+++ b/Makefile
@@ -40,3 +40,27 @@ serve:
test:
export HUGO_TEST=1 && hugo --ignoreCache --verbose=false
+
+buildmoehring: clean
+ @# Concat all CSS files
+ gulp concat
+ @# Build the HTML the first time to be ...
+ HUGO_GULP=0 hugo --baseURL=https://www.moehring.guru/ --ignoreCache --log=true --logFile=./log/hugo.log --verbose=false #1>/dev/null
+ @# ... spidered by uncss to remove the unnecessary selector rules.
+ gulp uncss
+ @# Builds the site again, but this time the minified CSS will be inlined by Hugo.
+ HUGO_GULP=1 hugo --baseURL=https://www.moehring.guru/ --ignoreCache --log=true --logFile=./log/hugo.log --verbose=false 1>/dev/null
+ @# Minifies the HTML!
+ gulp minifyhtml
+ @# Cleans up.
+ rm -rf public/gulp.css/
+ rm -f public/*.css
+
+deploymoehring: buildmoehring
+ @# Deploy to the server!
+ if [ -d /var/www/www.moehring.guru ]; then\
+ ( rsync --delete -avz public/ /var/www/www.moehring.guru/ 1>/dev/null 2>/dev/null && \
+ echo "Success: Site www.moehring.guru was built.") || ./error.sh; \
+ else \
+ rsync --delete -avze ssh public/ online:/var/www/www.moehring.guru/; \
+ fi