Commit 452d4b1f authored by fred's avatar fred

add meta tags for twitter cards

parent be9dc797
......@@ -14,6 +14,12 @@
<meta property="og:title" content="Radio Panik - 105.4 FM" />
<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…" />
<meta name="twitter:card" content="summary" />
<meta name="twitter:title" content="Radio Panik - 105.4 FM" />
<meta name="twitter:image" content="{{ site_url }}{% static 'img/Radio_Panik_Logo_2016-01.png' %}" />
<meta name="twitter:description" content="En vous branchant sur le 105.4 FM, vous pénétrerez plus avant dans l'œil du cyclone…" />
{% endblock %}
<link rel="alternate" type="application/rss+xml" href="{% url 'rss-feed' %}" title="News rss feed">
......
......@@ -5,13 +5,22 @@
{% block head %}
<meta property="og:title" content="{{ emission.title }}" />
<meta name="twitter:title" content="{{ emission.title }}" />
{% if emission.image %}
<meta name="twitter:card" content="summary_large_image">
<meta property="og:image" content="{{ site_url }}{{ emission.image.url }}" />
<meta name="twitter:image" content="{{ site_url }}{{ emission.image.url }}" />
{% else %}
<meta name="twitter:card" content="summary">
<meta property="og:image" content="{{ site_url }}{% static 'img/Radio_Panik_Logo_2016-01.png' %}" />
<meta name="twitter:image" content="{{ site_url }}{% static 'img/Radio_Panik_Logo_2016-01.png' %}" />
{% endif %}
{% if emission.subtitle %}
<meta property="og:description" content="{{ emission.subtitle }}" />
<meta name="twitter:description" content="{{ emission.subtitle }}" />
{% else %}
<meta property="og:description" content="{{ emission.text|safe|striptags|truncatewords:75 }}"/>
<meta name="twitter:description" content="{{ emission.text|safe|striptags|truncatewords:75 }}"/>
{% endif %}
{% endblock %}
......
......@@ -4,15 +4,26 @@
{% block head %}
<meta property="og:title" content="{{ episode.emission.title }} - {{ episode.title }}" />
<meta name="twitter:title" content="{{ episode.emission.title }} - {{ episode.title }}" />
{% if episode.image %}
<meta name="twitter:card" content="summary_large_image">
<meta property="og:image" content="{{ site_url }}{{ episode.image.url }}" />
<meta name="twitter:image" content="{{ site_url }}{{ episode.image.url }}" />
{% elif episode.emission.image %}
<meta name="twitter:card" content="summary_large_image">
<meta property="og:image" content="{{ site_url }}{{ episode.emission.image.url }}" />
<meta name="twitter:image" content="{{ site_url }}{{ episode.emission.image.url }}" />
{% else %}
<meta name="twitter:card" content="summary">
<meta property="og:image" content="{{ site_url }}{% static 'img/Radio_Panik_Logo_2016-01.png' %}" />
<meta name="twitter:image" content="{{ site_url }}{% static 'img/Radio_Panik_Logo_2016-01.png' %}" />
{% endif %}
{% if episode.subtitle %}
<meta property="og:description" content="{{ episode.subtitle }}" />
<meta name="twitter:description" content="{{ episode.subtitle }}" />
{% else %}
<meta property="og:description" content="{{ episode.text|safe|striptags|truncatewords:75 }}"/>
<meta name="twitter:description" content="{{ episode.text|safe|striptags|truncatewords:75 }}"/>
{% endif %}
{% if episode.main_sound %}
<meta property="og:audio" content="{{ site_url }}{{ episode.main_sound|format_url:'ogg' }}"/>
......
......@@ -8,11 +8,17 @@
{% block head %}
<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…" />
<meta name="twitter:title" content="{{ newsitem.title }}" />
<meta property="og:description" content="{{ newsitem.text|safe|striptags|truncatewords:75 }}"/>
<meta name="twitter:description" content="{{ newsitem.text|safe|striptags|truncatewords:75 }}"/>
{% if newsitem.image %}
<meta name="twitter:card" content="summary_large_image">
<meta property="og:image" content="{{ site_url }}{{ newsitem.image.url }}" />
<meta name="twitter:image" content="{{ site_url }}{{ newsitem.image.url }}" />
{% else %}
<meta name="twitter:card" content="summary">
<meta property="og:image" content="{{ site_url }}% static 'img/Radio_Panik_Logo_2016-01.png' %}" />
<meta name="twitter: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