Commit b0c95fed authored by fred's avatar fred

force absolute URLs in feeds

parent 3ce828e3
......@@ -360,3 +360,10 @@ def image_file(page):
except Topik.DoesNotExist:
pass
return None
@register.filter
def set_absolute_urls(text):
text = text.replace('src="/', 'src="%s' % settings.WEBSITE_BASE_URL)
text = text.replace('href="/', 'href="%s' % settings.WEBSITE_BASE_URL)
return text
......@@ -230,6 +230,8 @@ TEMPLATE_VARS = {}
COMBO_DASHBOARD_ENABLED = False
WEBSITE_BASE_URL = 'http://www.radiopanik.org/'
try:
from local_settings import *
except ImportError, e:
......
{% load thumbnail %}
{% load paniktags thumbnail %}
{% if obj.image %}
{% thumbnail obj.image "320x240" crop="50% 25%" as im %}
<img src="{{im.url}}"/>
......@@ -6,5 +6,5 @@
{% endif %}
{% autoescape off %}
{{ obj.text }}
{{ obj.text|set_absolute_urls }}
{% endautoescape %}
{% load thumbnail %}
{% load paniktags thumbnail %}
{% if obj.episode.image %}
{% thumbnail obj.episode.image "320x240" crop="50% 25%" as im %}
<img src="{{im.url}}"/>
......@@ -6,5 +6,5 @@
{% endif %}
{% autoescape off %}
{{ obj.episode.text }}
{{ obj.episode.text|set_absolute_urls }}
{% endautoescape %}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment