mirror of
https://github.com/bookwyrm-social/bookwyrm.git
synced 2024-06-03 05:49:35 +00:00
Use Status.page_image for OpenGraph tags
This commit is contained in:
parent
290ee997b3
commit
ea9d3f8ba1
|
@ -6,7 +6,7 @@
|
||||||
|
|
||||||
|
|
||||||
{% block opengraph %}
|
{% block opengraph %}
|
||||||
{% include 'snippets/opengraph.html' with image=preview %}
|
{% include 'snippets/opengraph.html' with image=page_image %}
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
|
|
||||||
|
|
||||||
|
@ -39,4 +39,4 @@
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
|
|
|
@ -185,12 +185,6 @@ class Status(View):
|
||||||
params=[status.id, visible_thread, visible_thread],
|
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 = {
|
data = {
|
||||||
**feed_page_data(request.user),
|
**feed_page_data(request.user),
|
||||||
**{
|
**{
|
||||||
|
@ -199,7 +193,7 @@ class Status(View):
|
||||||
"ancestors": ancestors,
|
"ancestors": ancestors,
|
||||||
"title": status.page_title,
|
"title": status.page_title,
|
||||||
"description": status.page_description,
|
"description": status.page_description,
|
||||||
"preview": preview,
|
"page_image": status.page_image,
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
return TemplateResponse(request, "feed/status.html", data)
|
return TemplateResponse(request, "feed/status.html", data)
|
||||||
|
|
Loading…
Reference in a new issue