From c28e2bf4d6c8cddfaa07429a62ca5dfa43f500a4 Mon Sep 17 00:00:00 2001 From: Gustavo Date: Wed, 14 Sep 2016 15:29:46 -0300 Subject: [PATCH] Responsive adsense banners on articles --- README.md | 10 ++++++++++ templates/adsense-banner.html | 12 ++++++++++++ templates/article.html | 9 +++++++++ 3 files changed, 31 insertions(+) create mode 100644 templates/adsense-banner.html diff --git a/README.md b/README.md index 825efd2..e5c56b5 100644 --- a/README.md +++ b/README.md @@ -25,6 +25,16 @@ The minimalist [Pelican](http://blog.getpelican.com/) theme. - [Piwik](http://piwik.org/) - [StatusCake](https://www.statuscake.com/) +## Adsense banner + +The theme support responsive adsense banners on the top/bottom of articles. +To configure it create a responsive banner on your adsense account and set this on your pelicanconf. + +ADSENSE_AD_CLIENT = 'YOUR AD CLIENT' +ADSENSE_AD_SLOT = 'YOUR AD SLOT' +SHOW_ADSENSE_ARTICLE_TOP = True/False +SHOW_ADSENSE_ARTICLE_BOTTOM = True/False + ## Install The recommend way to install is over [pelican-themes](https://github.com/getpelican/pelican-themes). diff --git a/templates/adsense-banner.html b/templates/adsense-banner.html new file mode 100644 index 0000000..8e47f64 --- /dev/null +++ b/templates/adsense-banner.html @@ -0,0 +1,12 @@ + +{% if ADSENSE_AD_CLIENT and ADSENSE_AD_SLOT %} + + + +{% endif %} diff --git a/templates/article.html b/templates/article.html index f453e84..b5bfedb 100644 --- a/templates/article.html +++ b/templates/article.html @@ -12,6 +12,10 @@ {% block content %}
+ + {% if SHOW_ADSENSE_ARTICLE_TOP %} + {% include "adsense-banner.html" %} + {% endif %}

{{ article.title }}

{{ _('Posted on %(when)s in %(category)s', @@ -26,6 +30,11 @@

{{ article.content }}
+ + {% if SHOW_ADSENSE_ARTICLE_BOTTOM %} + {% include "adsense-banner.html" %} + {% endif %} +

{% if article.tags %}