more metadata

This commit is contained in:
j 2021-10-31 11:17:38 +00:00
parent 05d2a75d5d
commit d1e1f311f0
2 changed files with 25 additions and 0 deletions

View file

@ -7,6 +7,29 @@
<meta property="og:url" content="https://phantas.ma{{ text.get_absolute_url }}"/>
<meta property="og:site_name" content="Phantas.ma"/>
<meta property="og:description" content="{{ text.byline|striptags }}"/>
<meta name="title" content="{{ text.title }}"/>
<meta name="description" content="{{ text.byline|striptags }}"/>
{% if text.data.related %}
<meta content="{{ stream_prefix }}{{ text.data.related}}/loop.jpg" name="thumbnail"/>
<meta content="{{ stream_prefix }}{{ text.data.related }}/loop.jpg" name="image_src"/>
<meta property="twitter:image" content="{{ stream_prefix }}{{ text.data.related }}/loop.jpg"/>
<meta property="og:image" content="{{ stream_prefix }}{{ text.data.related }}/loop.jpg"/>
{% elif text.data.item %}
<meta content="{{ stream_prefix }}{{ text.data.item}}/loop.jpg" name="thumbnail"/>
<meta content="{{ stream_prefix }}{{ text.data.item }}/loop.jpg" name="image_src"/>
<meta property="twitter:image" content="{{ stream_prefix }}{{ text.data.item }}/loop.jpg"/>
<meta property="og:image" content="{{ stream_prefix }}{{ text.data.item }}/loop.jpg"/>
{% endif %}
<meta property="og:site_name" content="Phantas.ma"/>
<meta property="og:description" content="{% for director in text.data.director %}{{ director|safe }}{% endfor %}"/>
<meta property="twitter:card" content="summary_large_image"/>
<meta property="twitter:title" content="{{ text.title | safe }}"/>
<meta property="twitter:description" content="{{ text.byline|striptags }}"/>
{% endblock head %}
{% block main %}
<div id="ascroll"></div>

View file

@ -2,6 +2,7 @@ from django.shortcuts import render, redirect, get_object_or_404
from django.conf import settings
from . import models
from ..video.views import get_stream_prefix
def fallback(request, slug=''):
if not slug:
@ -51,4 +52,5 @@ def text(request, slug):
context['text'] = get_object_or_404(models.Text, slug=slug)
else:
context['text'] = get_object_or_404(models.Text, slug=slug, public=True)
context['stream_prefix'] = get_stream_prefix(request)
return render(request, 'text.html', context)