mirror of
https://git.sr.ht/~cadence/bibliogram
synced 2024-11-23 00:27:30 +00:00
Write type of post in title
This commit is contained in:
parent
ecdd37dd1b
commit
9f5326fb58
@ -10,7 +10,13 @@ html
|
|||||||
script(type="module" src="/static/js/post_overlay.js")
|
script(type="module" src="/static/js/post_overlay.js")
|
||||||
meta(property="og:url" content=`${website_origin}/p/${post.data.shortcode}`)
|
meta(property="og:url" content=`${website_origin}/p/${post.data.shortcode}`)
|
||||||
meta(property="og:type" content="article")
|
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 = ""
|
- let description = ""
|
||||||
if post.getCaption()
|
if post.getCaption()
|
||||||
- description = post.getCaption()
|
- description = post.getCaption()
|
||||||
@ -20,7 +26,6 @@ html
|
|||||||
- description = `Gallery of ${post.children.length} images.${description}`
|
- description = `Gallery of ${post.children.length} images.${description}`
|
||||||
if description
|
if description
|
||||||
meta(property="og:description" content=description)
|
meta(property="og:description" content=description)
|
||||||
- let firstEntry = post.children[0]
|
|
||||||
if firstEntry.isVideo()
|
if firstEntry.isVideo()
|
||||||
meta(property="og:video" content=`${website_origin}${firstEntry.getVideoUrlP()}`)
|
meta(property="og:video" content=`${website_origin}${firstEntry.getVideoUrlP()}`)
|
||||||
meta(property="og:video:type" content="video/mp4")
|
meta(property="og:video:type" content="video/mp4")
|
||||||
|
Loading…
Reference in New Issue
Block a user