Move blog Google ads logic into core Rophako

This commit is contained in:
Noah 2014-04-29 21:50:15 -07:00
parent 2b3f0a748a
commit 18dab04f73
2 changed files with 21 additions and 0 deletions

View File

@ -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>

View File

@ -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 %}