Browse Source

Move blog Google ads logic into core Rophako

pull/2/head
Noah Petherbridge 8 years ago
parent
commit
18dab04f73
  1. 6
      rophako/www/blog/entry.inc.html
  2. 15
      rophako/www/google-ads.inc.html

6
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 @@
</div>
<p>
{# 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" %}
<p>

15
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!<p>{% endmacro %}
Loading…
Cancel
Save