From 25810ed61f0208e5a5b8450d1b911e892a8be546 Mon Sep 17 00:00:00 2001 From: Horus3 Date: Tue, 6 Dec 2016 23:12:40 +0100 Subject: Fixt uncss + lazyloaded die Galleriethumbnails. (Verhindert aktuell die Darstellung der Bilder ohne Javascript, was eventuell gar nicht so schlecht ist.) --- gospeladlershof.de/Makefile | 24 +++-- gospeladlershof.de/gulpfile.js | 27 ++++- gospeladlershof.de/layouts/index.html | 28 ++--- gospeladlershof.de/layouts/partials/header.tmpl | 4 +- gospeladlershof.de/layouts/partials/js.tmpl | 11 +- gospeladlershof.de/static/js/gc.js | 122 ---------------------- gospeladlershof.de/static/js/gospelchor.js | 132 ++++++++++++++++++++++++ 7 files changed, 193 insertions(+), 155 deletions(-) delete mode 100644 gospeladlershof.de/static/js/gc.js create mode 100644 gospeladlershof.de/static/js/gospelchor.js diff --git a/gospeladlershof.de/Makefile b/gospeladlershof.de/Makefile index 23b7e6c..9995662 100644 --- a/gospeladlershof.de/Makefile +++ b/gospeladlershof.de/Makefile @@ -6,11 +6,15 @@ build: clean || ( echo "Failure building the site." && exit 1) gulp concat gulp uncss - @HUGO_READ_CONCAT=0 HUGO_TEST=0 \ + gulp concat2 + gulp concatjs + @HUGO_READ_CONCAT=1 HUGO_TEST=0 \ hugo --ignoreCache --log=true --logFile=../log/hugo.log --verbose=false \ || ( echo "Failure building the site." && exit 1) gulp minifyhtml rm -rf public/css + rm -rf public/uncss + cd public/js && mkdir _tmp_ && mv lazyload.min.js chor.min.js _tmp_ && rm -f *.js && mv _tmp_/*.js . && rmdir _tmp_ serve: server @@ -26,16 +30,22 @@ deploy: build clean: $(RM) $(RMFLAGS) -r public/ - $(RM) $(RMFLAGS) static/concat.css - $(RM) $(RMFLAGS) -r static/gulp.css/ + $(RM) $(RMFLAGS) static/css/concat.css + $(RM) $(RMFLAGS) -r static/uncss/ + $(RM) $(RMFLAGS) static/js/chor.js + $(RM) $(RMFLAGS) static/js/chor.min.js localbuild: clean - @HUGO_TEST=1 hugo --baseURL="http://192.168.178.68:3000/" --ignoreCache --log=true --logFile=../log/hugo.log --verbose=false 1>/dev/null \ + HUGO_TEST=1 hugo --baseURL="http://0.0.0.0:3000/" --ignoreCache --log=true --logFile=../log/hugo.log --verbose=false 1>/dev/null \ || ( echo "Failure building the site." && exit 1) gulp concat gulp uncss - @HUGO_READ_CONCAT=1 HUGO_TEST=0 \ - hugo --baseURL="http://192.168.178.68:3000/" --ignoreCache --log=true --logFile=../log/hugo.log --verbose=false \ + gulp concat2 + gulp concatjs + HUGO_READ_CONCAT=1 HUGO_TEST=0 \ + hugo --baseURL="http://0.0.0.0:3000/" --ignoreCache --log=true --logFile=../log/hugo.log --verbose=false \ || ( echo "Failure building the site." && exit 1) gulp minifyhtml - #rm -rf public/css + rm -rf public/css + rm -rf public/uncss + cd public/js && mkdir _tmp_ && mv lazyload.min.js chor.min.js _tmp_ && rm -f *.js && mv _tmp_/*.js . && rmdir _tmp_ diff --git a/gospeladlershof.de/gulpfile.js b/gospeladlershof.de/gulpfile.js index ec97e58..06601c8 100644 --- a/gospeladlershof.de/gulpfile.js +++ b/gospeladlershof.de/gulpfile.js @@ -3,21 +3,40 @@ var cssnano = require('gulp-cssnano'); var htmlmin = require('gulp-htmlmin'); var uncss = require('gulp-uncss'); var concat = require('gulp-concat'); +var minify = require('gulp-minify'); gulp.task('concat', function() { - return gulp.src(['static/css/animate.min.css', 'static/css/bootstrap.min.css', 'static/css/magnific-popup.css', 'static/css/theme.css', 'static/css/chor.css']) + //return gulp.src(['static/css/animate.min.css', 'static/css/bootstrap.min.css']) + return gulp.src(['static/css/bootstrap.min.css']) .pipe(concat('concat.css')) - .pipe(gulp.dest('./static/')); + .pipe(gulp.dest('./static/css/')); }); gulp.task('uncss', function() { - return gulp.src('static/concat.css') + return gulp.src('static/css/concat.css') .pipe(uncss({ html: ['public/*.html', 'public/impressum/*.html'], ignore: ['.text-right', '.text-left', '.affix', '.navbar-default.affix'] })) .pipe(cssnano()) - .pipe(gulp.dest('./static/gulp.css')); + .pipe(gulp.dest('./static/uncss')); +}); +gulp.task('concat2', function() { + return gulp.src(['static/uncss/concat.css', 'static/css/magnific-popup.css', 'static/css/theme.css', 'static/css/chor.css']) + .pipe(cssnano()) + .pipe(concat('concat.css')) + .pipe(gulp.dest('./static/uncss/')); +}); +gulp.task('concatjs', function() { + //gulp.src(['static/js/lazyload.min.js', 'static/js/jquery.min.js', 'static/js/bootstrap.min.js', 'static/js/jquery.easing.min.js', 'static/js/jquery.fittext.js', 'static/js/jquery.magnific-popup.js', 'static/js/gospelchor.js']) + gulp.src(['static/js/jquery.min.js', 'static/js/bootstrap.min.js', 'static/js/jquery.easing.min.js', 'static/js/jquery.fittext.js', 'static/js/jquery.magnific-popup.js', 'static/js/gospelchor.js']) + .pipe(concat('chor.js')) + .pipe(minify({ + ext: { + min:'.min.js' + } + })) + .pipe(gulp.dest('./static/js/')); }); gulp.task('minifyhtml', function() { diff --git a/gospeladlershof.de/layouts/index.html b/gospeladlershof.de/layouts/index.html index 96ce488..ec89157 100644 --- a/gospeladlershof.de/layouts/index.html +++ b/gospeladlershof.de/layouts/index.html @@ -1,6 +1,6 @@ {{ $termine := getJSON "https://www.gospeladlershof.de/" "api/v1/termine" }} {{partial "header.tmpl" . }} - + {{partial "navbar.tmpl" .}} @@ -81,7 +81,7 @@