Commit 55008158 authored by fred's avatar fred

use absolute URIs in opengraph tags

parent dc3f8103
def site_url(request):
return {'site_url': request.build_absolute_uri('/').strip('/')}
......@@ -119,6 +119,7 @@ MIDDLEWARE_CLASSES = (
TEMPLATE_CONTEXT_PROCESSORS = DEFAULT_SETTINGS.TEMPLATE_CONTEXT_PROCESSORS + (
'django.core.context_processors.request',
'panikweb.context_processors.site_url',
)
......
......@@ -217,7 +217,6 @@ class SoundFileDialogEmbedView(DetailView):
if self.kwargs.get('emission_slug') != self.object.episode.emission.slug:
raise Http404()
context['episode'] = self.object.episode
context['site_url'] = self.request.build_absolute_uri('/').strip('/')
return context
soundfile_dlg_embed = SoundFileDialogEmbedView.as_view()
......
......@@ -12,7 +12,7 @@
<meta name="og:site_name" content="Radio Panik"/>
{% block head %}
<meta property="og:title" content="Radio Panik - 105.4 FM" />
<meta property="og:image" content="{% static 'img/Radio_Panik_Logo_2016-01.png' %}" />
<meta property="og:image" content="{{ site_url }}{% static 'img/Radio_Panik_Logo_2016-01.png' %}" />
<meta property="og:description" content="En vous branchant sur le 105.4 FM, vous pénétrerez plus avant dans l'œil du cyclone…" />
{% endblock %}
......
......@@ -6,9 +6,9 @@
{% block head %}
<meta property="og:title" content="{{ emission.title }}" />
{% if emission.image %}
<meta property="og:image" content="{{ emission.image.url }}" />
<meta property="og:image" content="{{ site_url }}{{ emission.image.url }}" />
{% else %}
<meta property="og:image" content="{% static 'img/Radio_Panik_Logo_2016-01.png' %}" />
<meta property="og:image" content="{{ site_url }}{% static 'img/Radio_Panik_Logo_2016-01.png' %}" />
{% endif %}
{% if emission.subtitle %}
<meta property="og:description" content="{{ emission.subtitle }}" />
......
......@@ -5,17 +5,17 @@
{% block head %}
<meta property="og:title" content="{{ episode.emission.title }} - {{ episode.title }}" />
{% if episode.image %}
<meta property="og:image" content="{{ episode.image.url }}" />
<meta property="og:image" content="{{ site_url }}{{ episode.image.url }}" />
{% elif episode.emission.image %}
<meta property="og:image" content="{{ episode.emission.image.url }}" />
<meta property="og:image" content="{{ site_url }}{{ episode.emission.image.url }}" />
{% else %}
<meta property="og:image" content="{% static 'img/Radio_Panik_Logo_2016-01.png' %}" />
<meta property="og:image" content="{{ site_url }}{% static 'img/Radio_Panik_Logo_2016-01.png' %}" />
{% endif %}
{% if episode.subtitle %}
<meta property="og:description" content="{{ episode.subtitle }}" />
{% endif %}
{% if episode.main_sound %}
<meta property="og:audio" content="{{ episode.main_sound|format_url:'ogg' }}"/>
<meta property="og:audio" content="{{ site_url }}{{ episode.main_sound|format_url:'ogg' }}"/>
<meta property="og:audio:type" content="audio/ogg"/>
{% endif %}
{% endblock %}
......
......@@ -10,9 +10,9 @@
<meta property="og:title" content="{{ newsitem.title }}" />
<meta property="og:description" content="En vous branchant sur le 105.4 FM, vous pénétrerez plus avant dans l'œil du cyclone…" />
{% if newsitem.image %}
<meta property="og:image" content="{{ newsitem.image.url }}" />
<meta property="og:image" content="{{ site_url }}{{ newsitem.image.url }}" />
{% else %}
<meta property="og:image" content="{% static 'img/Radio_Panik_Logo_2016-01.png' %}" />
<meta property="og:image" content="{{{ site_url }}% static 'img/Radio_Panik_Logo_2016-01.png' %}" />
{% endif %}
{% endblock %}
......
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