From 669f78c5259ff4b152f500215822ed14010fadd4 Mon Sep 17 00:00:00 2001 From: Ariejan de Vroom Date: Wed, 15 Nov 2017 15:13:10 +0100 Subject: [PATCH] Show a friendly message to ad blockers --- themes/cocoa-eh/layouts/blog/single.html | 4 +- .../cocoa-eh/layouts/electronics/single.html | 4 +- themes/cocoa-eh/layouts/partials/css/main.css | 4 + .../layouts/partials/footer_scripts.html | 34 +++++++ .../layouts/partials/recommendations.html | 90 +++++++++---------- 5 files changed, 84 insertions(+), 52 deletions(-) diff --git a/themes/cocoa-eh/layouts/blog/single.html b/themes/cocoa-eh/layouts/blog/single.html index 317c84b..c2e1c5f 100644 --- a/themes/cocoa-eh/layouts/blog/single.html +++ b/themes/cocoa-eh/layouts/blog/single.html @@ -39,9 +39,7 @@
{{ partial "content" . }} - {{ if .Site.Params.book_recommendations }} - {{ partial "recommendations.html" . }} - {{ end }} + {{ partial "recommendations.html" . }}
{{ if .Site.Params.share }}
diff --git a/themes/cocoa-eh/layouts/electronics/single.html b/themes/cocoa-eh/layouts/electronics/single.html index e8e429c..da6f503 100644 --- a/themes/cocoa-eh/layouts/electronics/single.html +++ b/themes/cocoa-eh/layouts/electronics/single.html @@ -39,9 +39,7 @@
{{ partial "content" . }} - {{ if .Site.Params.book_recommendations }} - {{ partial "recommendations.html" . }} - {{ end }} + {{ partial "recommendations.html" . }}
{{ if .Site.Params.share }}
diff --git a/themes/cocoa-eh/layouts/partials/css/main.css b/themes/cocoa-eh/layouts/partials/css/main.css index 6965f6e..53c75cc 100644 --- a/themes/cocoa-eh/layouts/partials/css/main.css +++ b/themes/cocoa-eh/layouts/partials/css/main.css @@ -704,4 +704,8 @@ section.main .content .share a { .book-recommendations { padding: 1em 0; text-align: center; +} + +#adblock-detected-message { + display: none; } \ No newline at end of file diff --git a/themes/cocoa-eh/layouts/partials/footer_scripts.html b/themes/cocoa-eh/layouts/partials/footer_scripts.html index 079e248..5afa9f2 100644 --- a/themes/cocoa-eh/layouts/partials/footer_scripts.html +++ b/themes/cocoa-eh/layouts/partials/footer_scripts.html @@ -35,6 +35,40 @@ {{ end }} + + {{ template "_internal/google_analytics_async.html" . }} -
-{{ else if in .Params.tags "vim" }} -
-

Learn more about Vim

- -
-{{ else if in .Params.tags "tmux" }} -
-

Learn more about tmux!

- -
-{{ else if or (in .Params.tags "electronics") (in .Params.tags "repair") }} -
-

Learn more about Electronics!

- -
-{{ else if and (in .Params.tags "Linux") (in .Params.tags "debian") }} -
-

Learn more about Debian Linux!

- -
-{{ else if and (in .Params.tags "linux") (in .Params.tags "ubuntu") }} -
-

Learn more about Ubuntu Linux!

- -
-{{ else if in .Params.tags "linux" }} -
-

Learn more about Linux!

- -
-{{ else if or (in .Params.tags "rails") (in .Params.tags "ruby") }} -
-

Learn more about Ruby on Rails!

- -
-{{ else if in .Params.tags "bitcoin" }} -
-

Learn more about Bitcoin!

- -
-{{ end }} +{{ if .Site.Params.book_recommendations }} +
+ + {{ if in .Params.tags "git" }} +

Learn more about git!

+ + {{ else if in .Params.tags "vim" }} +

Learn more about Vim

+ + {{ else if in .Params.tags "tmux" }} +

Learn more about tmux!

+ + {{ else if or (in .Params.tags "electronics") (in .Params.tags "repair") }} +

Learn more about Electronics!

+ + {{ else if and (in .Params.tags "Linux") (in .Params.tags "debian") }} +

Learn more about Debian Linux!

+ + {{ else if and (in .Params.tags "linux") (in .Params.tags "ubuntu") }} +

Learn more about Ubuntu Linux!

+ + {{ else if in .Params.tags "linux" }} +

Learn more about Linux!

+ + {{ else if or (in .Params.tags "rails") (in .Params.tags "ruby") }} +

Learn more about Ruby on Rails!

+ + {{ else if in .Params.tags "bitcoin" }} +

Learn more about Bitcoin!

+ + {{ end }} + +
+

+ If you're seeing this message you've probably enabled some form of adblocker. I respect that. +

+

+ I use this space to show recommended books on Amazon.com in relation to + the post you just read. This generates a small income that allows me to buy a + book every now and then. +

+
+ +{{ end }} \ No newline at end of file