From 18dab04f73843f132d92ac915d621c151e7f378f Mon Sep 17 00:00:00 2001 From: Noah Petherbridge Date: Tue, 29 Apr 2014 21:50:15 -0700 Subject: [PATCH] Move blog Google ads logic into core Rophako --- rophako/www/blog/entry.inc.html | 6 ++++++ rophako/www/google-ads.inc.html | 15 +++++++++++++++ 2 files changed, 21 insertions(+) create mode 100644 rophako/www/google-ads.inc.html diff --git a/rophako/www/blog/entry.inc.html b/rophako/www/blog/entry.inc.html index 8f43672..0ce6728 100644 --- a/rophako/www/blog/entry.inc.html +++ b/rophako/www/blog/entry.inc.html @@ -1,4 +1,5 @@ {# Reusable template for showing a blog post content #} +{% from "google-ads.inc.html" import leaderboard %} {% macro blog_entry(post, from=None) %} @@ -69,6 +70,11 @@

+ {# Show the Google ad after the first post. #} + {% if from == "index" and post["position_index"] == 1 %} + {{ leaderboard() }} + {% endif %} + {% if from != "index" %} {% include "blog/sibling-links.html" %}

diff --git a/rophako/www/google-ads.inc.html b/rophako/www/google-ads.inc.html new file mode 100644 index 0000000..d513631 --- /dev/null +++ b/rophako/www/google-ads.inc.html @@ -0,0 +1,15 @@ +{############################################################################## + # Macro to support Google AdSense ad banners for Rophako. + # + # Copy this HTML page into your own site's www folder and paste in the code for + # your Google ads inside the macros. The macros "nav_ads()" and "leaderboard()" + # must be present in this file, even if not used by your site, because the + # blog entry.inc.html page needs the leaderboard function. + # + # I did this because I use Google ads on Kirsle.net and I don't want to + # maintain a 99%-identical copy of blog/entry.inc.html just for Kirsle.net. :) + ##############################################################################} + +{# Macro for leaderboard shaped Google ads. DO NOT REMOVE THIS MACRO OR THE + BLOG WILL BREAK. #} +{% macro leaderboard() %}LeaderBOARD!

{% endmacro %}