Merge pull request #3237 from Minnozz/status-title-description
Improve OpenGraph tags for status and book pages
This commit is contained in:
commit
e0667c6a03
5 changed files with 81 additions and 28 deletions
|
@ -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)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue