Use Status.page_image for OpenGraph tags

This commit is contained in:
Bart Schuurmans 2024-01-20 17:25:20 +01:00
parent 290ee997b3
commit ea9d3f8ba1
2 changed files with 3 additions and 9 deletions

View file

@ -6,7 +6,7 @@
{% block opengraph %}
{% include 'snippets/opengraph.html' with image=preview %}
{% include 'snippets/opengraph.html' with image=page_image %}
{% endblock %}
@ -39,4 +39,4 @@
</div>
</div>
{% endblock %}
{% endblock %}

View file

@ -185,12 +185,6 @@ class Status(View):
params=[status.id, visible_thread, visible_thread],
)
preview = None
if hasattr(status, "book"):
preview = status.book.preview_image
elif status.mention_books.exists():
preview = status.mention_books.first().preview_image
data = {
**feed_page_data(request.user),
**{
@ -199,7 +193,7 @@ class Status(View):
"ancestors": ancestors,
"title": status.page_title,
"description": status.page_description,
"preview": preview,
"page_image": status.page_image,
},
}
return TemplateResponse(request, "feed/status.html", data)