From 6c577a65339ac597ac622fb839393f931562cf8e Mon Sep 17 00:00:00 2001 From: Horus3 Date: Sat, 22 Oct 2016 12:20:46 +0200 Subject: Fix the projects page, improves the piwik script, concats the assets with gulp and styles the 404 template. --- Makefile | 14 +++++++++++--- config.toml | 2 +- gulpfile.js | 12 ++++++++++-- layouts/404.html | 38 ++++++++++++++++++++++++++++++++++---- layouts/_default/list.html | 2 +- layouts/index.html | 6 +++--- layouts/partials/css.tmpl | 7 ++++++- layouts/partials/footer.tmpl | 8 +++----- layouts/projects.html | 39 --------------------------------------- layouts/projects/single.html | 32 ++++++++++++++++---------------- static/custom.css | 13 +++++++++++++ 11 files changed, 98 insertions(+), 75 deletions(-) delete mode 100644 layouts/projects.html diff --git a/Makefile b/Makefile index 3dcfa83..639a59e 100644 --- a/Makefile +++ b/Makefile @@ -1,10 +1,17 @@ all: clean build build: clean - cd static && cat normalize.css skeleton.css font.css custom.css > concat.css - gulp - HUGO_TEST= hugo --ignoreCache --log=true --logFile=./log/hugo.log --verbose=false 1>/dev/null + @# Concat all CSS files + gulp concat + @# Build the HTML the first time to be ... + HUGO_GULP=0 hugo --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 --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 @@ -20,6 +27,7 @@ index: cat public/index.html deploy: clean build + @# Deploy to the server! if [ -d /var/www/www.iamfabulous.de ]; then\ ( rsync --delete -avz public/ /var/www/www.iamfabulous.de/ 1>/dev/null 2>/dev/null && \ echo "Success: Site www.iamfabulous.de was built.") || ./error.sh; \ diff --git a/config.toml b/config.toml index 790fea9..22bb5e0 100644 --- a/config.toml +++ b/config.toml @@ -1,6 +1,6 @@ baseurl = "https://www.iamfabulous.de/" languageCode = "en-us" -title = "moehring" +title = "welcome" disableHugoGeneratorInject = true disableRSS = false disableSitemap = true diff --git a/gulpfile.js b/gulpfile.js index dbf1406..e413a14 100644 --- a/gulpfile.js +++ b/gulpfile.js @@ -2,11 +2,19 @@ var gulp = require('gulp'); var cssnano = require('gulp-cssnano'); var htmlmin = require('gulp-htmlmin'); var uncss = require('gulp-uncss'); +var concat = require('gulp-concat'); -gulp.task('default', function() { +gulp.task('concat', function() { + return gulp.src(['static/normalize.css', 'static/skeleton.css', 'static/font.css', 'static/custom.css']) + .pipe(concat('concat.css')) + .pipe(gulp.dest('./static/')); +}); + +gulp.task('uncss', function() { return gulp.src('static/concat.css') .pipe(uncss({ - html: ['layouts/*.html', 'layouts/partials/*.html', 'layouts/_default/*.html'] + html: ['public/*.html', 'public/projects/*.html', 'public/journal/*.html', 'public/journal/**/*.html'], + ignore: ['.text-right', '.text-left'] })) .pipe(cssnano()) .pipe(gulp.dest('./static/gulp.css')); diff --git a/layouts/404.html b/layouts/404.html index b40f7ea..3171635 100644 --- a/layouts/404.html +++ b/layouts/404.html @@ -1,7 +1,37 @@ {{partial "header.tmpl" .}} -

404 - not found


-

- click to go back -

+
+

404 - not found

+
+ +
+
+
+
    +
  • +
    Here is nothing.
    +
    +
    +_                ___       _.--. 
    +\`.|\..----...-'`   `-._.-'_.-'` 
    +/  ' `         ,       __.--'    
    +)/' _/     \   `-_,   /          
    +`-'" `"\_  ,_.-;_.-\_ ',         
    +    _.-'_./   {_.'   ; /         
    +   {_.-``-'         {_/          
    +   ~~~~~~          ~~~~~         
    +					
    +
  • +
+
+
+
+ +
+
+

+ click to go back +

+
+
{{partial "footer.tmpl"}} diff --git a/layouts/_default/list.html b/layouts/_default/list.html index 690e09f..4f9b3aa 100644 --- a/layouts/_default/list.html +++ b/layouts/_default/list.html @@ -1,6 +1,6 @@ {{partial "header.tmpl" .}}
-

journal

+

journal

{{ range .Data.Pages }}
diff --git a/layouts/index.html b/layouts/index.html index 522daf5..94aa532 100644 --- a/layouts/index.html +++ b/layouts/index.html @@ -7,13 +7,13 @@
my blog
-
+ -
+ - diff --git a/layouts/partials/css.tmpl b/layouts/partials/css.tmpl index a10e818..45efad7 100644 --- a/layouts/partials/css.tmpl +++ b/layouts/partials/css.tmpl @@ -6,6 +6,11 @@ {{else}} {{end}} diff --git a/layouts/partials/footer.tmpl b/layouts/partials/footer.tmpl index 8cc61ad..408626b 100644 --- a/layouts/partials/footer.tmpl +++ b/layouts/partials/footer.tmpl @@ -1,7 +1,6 @@ {{$tmp := getenv "HUGO_TEST"}} {{if eq $tmp "1"}} {{else}} - - + - {{end}} diff --git a/layouts/projects.html b/layouts/projects.html deleted file mode 100644 index 103c7e0..0000000 --- a/layouts/projects.html +++ /dev/null @@ -1,39 +0,0 @@ - -{{partial "header.tmpl" "projects"}} -

projects


- -{{partial "footer.tmpl"}} diff --git a/layouts/projects/single.html b/layouts/projects/single.html index 6304f7d..71030c8 100644 --- a/layouts/projects/single.html +++ b/layouts/projects/single.html @@ -2,23 +2,23 @@

{{.Title}}

-
+

diff --git a/static/custom.css b/static/custom.css index 3c513ca..57fde38 100644 --- a/static/custom.css +++ b/static/custom.css @@ -88,3 +88,16 @@ a:hover { .margin-top { margin-top: 20px; } +.margin-top-small { + margin-top: 10px; +} + +/* Für projects/, damit der Text nicht überlappt, aber nah beieinander steht. */ +@media (min-width: 755px) { + .text-right { + text-align: right; + } + .text-left{ + text-align: left; + } +} -- cgit v1.2.3