Write type of post in title

This commit is contained in:
Cadence Fish 2020-03-05 01:18:37 +13:00
parent ecdd37dd1b
commit 9f5326fb58
No known key found for this signature in database
GPG Key ID: 81015DF9AA8607E1
1 changed files with 7 additions and 2 deletions

View File

@ -10,7 +10,13 @@ html
script(type="module" src="/static/js/post_overlay.js")
meta(property="og:url" content=`${website_origin}/p/${post.data.shortcode}`)
meta(property="og:type" content="article")
meta(property="og:title" content=`Post by ${post.data.owner.full_name || post.data.owner.username}`)
- let firstEntry = post.children[0]
- let postType = "Photo"
if post.children.length >= 2
- postType = "Post" //- it's a gallery, but "Gallery" doesn't really sound right
else if firstEntry.isVideo()
- postType = "Video"
meta(property="og:title" content=`${postType} by ${post.data.owner.full_name || post.data.owner.username}`)
- let description = ""
if post.getCaption()
- description = post.getCaption()
@ -20,7 +26,6 @@ html
- description = `Gallery of ${post.children.length} images.${description}`
if description
meta(property="og:description" content=description)
- let firstEntry = post.children[0]
if firstEntry.isVideo()
meta(property="og:video" content=`${website_origin}${firstEntry.getVideoUrlP()}`)
meta(property="og:video:type" content="video/mp4")