mirror of
https://github.com/TrentSPalmer/trentpalmerdotorg.git
synced 2024-11-23 18:01:30 -08:00
update og and twittercard
This commit is contained in:
parent
2d1c912be2
commit
45e8ef4dd9
@ -1,14 +1,27 @@
|
|||||||
{% extends "base.html" %}
|
{% extends "base.html" %}
|
||||||
{% block morehead %}
|
{% block morehead %}
|
||||||
{% if is_episode %}
|
{% if is_episode %}
|
||||||
<meta property="twitter:card" content="summary" />
|
<meta property="og:site_name" content="TrentReads" />
|
||||||
<meta property="twitter:creator" content="{{ user.account.twitter_handle }}" />
|
|
||||||
<meta property="twitter:image" content="{{ IMAGES_URL }}{{ twitter_image }}" />
|
|
||||||
<meta property="og:title" content="{{ ogtitle }}" />
|
<meta property="og:title" content="{{ ogtitle }}" />
|
||||||
|
<meta property="og:type" content="article" />
|
||||||
|
<meta property="og:description" content="{{ episodes.0.description }}" />
|
||||||
<meta property="og:url" content="{{ ogurl }}" />
|
<meta property="og:url" content="{{ ogurl }}" />
|
||||||
|
<meta property="og:image" content="{{ IMAGES_URL }}{{ twitter_image }}" />
|
||||||
<meta property="og:audio" content="{{ MP3_URL }}{{ ogmp3 }}" />
|
<meta property="og:audio" content="{{ MP3_URL }}{{ ogmp3 }}" />
|
||||||
<meta property="og:audio:secure" content="{{ MP3_URL }}{{ ogmp3 }}" />
|
<meta property="og:audio:secure" content="{{ MP3_URL }}{{ ogmp3 }}" />
|
||||||
<meta property="og:audio:type" content="audio/mpeg" />
|
<meta property="og:audio:type" content="audio/mpeg" />
|
||||||
|
<meta property="article:published_time" content="{{ episodes.0.p_date }}" />
|
||||||
|
<meta property="article:modified_time" content="{{ episodes.0.p_date }}" />
|
||||||
|
|
||||||
|
<meta name="twitter:card" content="summary" />
|
||||||
|
<meta name="twitter:title" content="{{ ogtitle }}" />
|
||||||
|
<meta name="twitter:description" content="{{ episodes.0.description }}" />
|
||||||
|
<meta name="twitter:url" content="{{ ogurl }}" />
|
||||||
|
<meta name="twitter:label1" content="Recorded by" />
|
||||||
|
<meta name="twitter:data1" content="{{ episodes.0.user.first_name }} {{ episodes.0.user.last_name }}" />
|
||||||
|
<meta name="twitter:site" content="@BoringTrent" />
|
||||||
|
<meta name="twitter:creator" content="{{ episodes.0.user.account.twitter_handle }}" />
|
||||||
|
<meta name="twitter:image" content="{{ IMAGES_URL }}{{ twitter_image }}" />
|
||||||
{% endif %}
|
{% endif %}
|
||||||
{% endblock morehead %}
|
{% endblock morehead %}
|
||||||
|
|
||||||
|
@ -29,6 +29,7 @@ def feed(request, pk, slug):
|
|||||||
|
|
||||||
def episode(request, pk, slug):
|
def episode(request, pk, slug):
|
||||||
episode = Episode.objects.get(id=pk)
|
episode = Episode.objects.get(id=pk)
|
||||||
|
episode.p_date = episode.pub_date.strftime('%Y-%m-%dT%H:%M:%SZ')
|
||||||
ogurl = reverse('audio:episode', kwargs={'pk': pk, 'slug': slug})
|
ogurl = reverse('audio:episode', kwargs={'pk': pk, 'slug': slug})
|
||||||
og_url = f'{get_current_site(request)}{ogurl}'
|
og_url = f'{get_current_site(request)}{ogurl}'
|
||||||
return render(
|
return render(
|
||||||
|
Loading…
Reference in New Issue
Block a user