From 77aa405fc68246e6ad0a2dbd03632cacdbc7d9f3 Mon Sep 17 00:00:00 2001 From: infinite-persistence <64950861+infinite-persistence@users.noreply.github.com> Date: Wed, 23 Feb 2022 21:11:57 -0800 Subject: [PATCH] Increase specificity of `og:type` (#955) Doesn't seem to do much, but it is what others do, so might as well be specific. --- web/src/html.js | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/web/src/html.js b/web/src/html.js index cd521dd6f..b8df494a7 100644 --- a/web/src/html.js +++ b/web/src/html.js @@ -164,6 +164,18 @@ function buildClaimOgMetadata(uri, claim, overrideOptions = {}, referrerQuery) { getThumbnailCdnUrl(OG_IMAGE_URL) || `${URL}/public/v2-og.png`; + const getOgType = (streamType) => { + switch (streamType) { + // https://ogp.me/?fbclid=IwAR0Dr3Rb3tw1W5wjFtuRMZfwewM2vlrSnNp-_ZKlvCzo5nKuX2TuTqt0kU8#types + case 'video': + return 'video.other'; + case 'audio': + return 'music.song'; + default: + return 'website'; + } + }; + // Allow for overriding default claim based og metadata const title = overrideOptions.title || claimTitle; const description = overrideOptions.description || claimDescription; @@ -192,7 +204,7 @@ function buildClaimOgMetadata(uri, claim, overrideOptions = {}, referrerQuery) { head += ``; head += ``; head += ``; - head += ``; + head += ``; head += ``; head += ``; head += ``;