From 9f5326fb58f76ac6c9e32a29c954d2f1bb5654d0 Mon Sep 17 00:00:00 2001 From: Cadence Fish Date: Thu, 5 Mar 2020 01:18:37 +1300 Subject: [PATCH] Write type of post in title --- src/site/pug/post.pug | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/site/pug/post.pug b/src/site/pug/post.pug index 8593a03..b1e7513 100644 --- a/src/site/pug/post.pug +++ b/src/site/pug/post.pug @@ -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")