Commit e590e996 authored by fred's avatar fred

feeds: also use an absolute URL for item image

parent b0c95fed
...@@ -367,3 +367,9 @@ def set_absolute_urls(text): ...@@ -367,3 +367,9 @@ def set_absolute_urls(text):
text = text.replace('src="/', 'src="%s' % settings.WEBSITE_BASE_URL) text = text.replace('src="/', 'src="%s' % settings.WEBSITE_BASE_URL)
text = text.replace('href="/', 'href="%s' % settings.WEBSITE_BASE_URL) text = text.replace('href="/', 'href="%s' % settings.WEBSITE_BASE_URL)
return text return text
@register.filter
def as_absolute_url(url):
if url.startswith('/'):
url = settings.WEBSITE_BASE_URL + url.lstrip('/')
return url
{% load paniktags thumbnail %} {% load paniktags thumbnail %}
{% if obj.image %} {% if obj.image %}
{% thumbnail obj.image "320x240" crop="50% 25%" as im %} {% thumbnail obj.image "320x240" crop="50% 25%" as im %}
<img src="{{im.url}}"/> <img src="{{im.url|as_absolute_url}}"/>
{% endthumbnail %} {% endthumbnail %}
{% endif %} {% endif %}
......
{% load paniktags thumbnail %} {% load paniktags thumbnail %}
{% if obj.episode.image %} {% if obj.episode.image %}
{% thumbnail obj.episode.image "320x240" crop="50% 25%" as im %} {% thumbnail obj.episode.image "320x240" crop="50% 25%" as im %}
<img src="{{im.url}}"/> <img src="{% url '{{im.url|as_absolute_url}}"/>
{% endthumbnail %} {% endthumbnail %}
{% endif %} {% endif %}
......
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