1
0
Fork 0

Merge pull request #3237 from Minnozz/status-title-description

Improve OpenGraph tags for status and book pages
This commit is contained in:
Mouse Reeve 2024-02-03 07:37:00 -08:00 committed by GitHub
commit e0667c6a03
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
5 changed files with 81 additions and 28 deletions

View file

@ -200,19 +200,15 @@ 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),
**{
"status": status,
"children": children,
"ancestors": ancestors,
"preview": preview,
"title": status.page_title,
"description": status.page_description,
"page_image": status.page_image,
},
}
return TemplateResponse(request, "feed/status.html", data)