bibliogram/src/site/pug/post.pug

41 lines
1.6 KiB
Plaintext
Raw Normal View History

2020-03-04 12:12:24 +00:00
//- Needs website_origin, title, post
2020-03-01 03:43:43 +00:00
2020-02-21 12:35:19 +00:00
include includes/post
2020-01-18 15:38:14 +00:00
doctype html
html
head
2020-03-01 03:43:43 +00:00
title= title
2020-02-05 06:05:18 +00:00
include includes/head
2020-02-21 12:35:19 +00:00
script(type="module" src="/static/js/post_overlay.js")
2020-03-04 12:12:24 +00:00
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 description = ""
if post.getCaption()
- description = post.getCaption()
if post.children.length >= 2
if description
- description = `\n\n${description}`
- 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")
meta(property="og:video:width" content=firstEntry.data.dimensions.width)
meta(property="og:video:height" content=firstEntry.data.dimensions.height)
meta(property="og:video:alt" content=firstEntry.getAlt())
else
meta(property="og:image" content=`${website_origin}${firstEntry.getDisplayUrlP()}`)
meta(property="og:image:width" content=firstEntry.data.dimensions.width)
meta(property="og:image:height" content=firstEntry.data.dimensions.height)
meta(property="og:image:type" content="image/jpeg")
meta(property="og:image:alt" content=firstEntry.getAlt())
meta(property="og:site_name" content="Bibliogram")
2020-01-18 15:38:14 +00:00
body.post-page
2020-02-21 12:35:19 +00:00
main
+post(post, false)