|
|
@ -1,9 +1,11 @@ |
|
|
|
<script> |
|
|
|
<script> |
|
|
|
|
|
|
|
import config from "$/client/config.js"; |
|
|
|
|
|
|
|
|
|
|
|
export let og = { |
|
|
|
export let og = { |
|
|
|
"title": "", // title of the article |
|
|
|
"title": "", // title of the article |
|
|
|
"description": "", // description for inside preview |
|
|
|
"description": "", // description for inside preview |
|
|
|
"image": "", // image to display, 5mb/1200/627 max |
|
|
|
"image": "", // image to display, 5mb/1200/627 max |
|
|
|
"url": "", // URL to article |
|
|
|
"url": config.og_base_host, // URL to article |
|
|
|
"type": "website", // not mentioned on linked in but needed |
|
|
|
"type": "website", // not mentioned on linked in but needed |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
@ -11,20 +13,36 @@ |
|
|
|
// also refer to https://developer.twitter.com/en/docs/twitter-for-websites/cards/overview/player-card |
|
|
|
// also refer to https://developer.twitter.com/en/docs/twitter-for-websites/cards/overview/player-card |
|
|
|
export let twitter = { |
|
|
|
export let twitter = { |
|
|
|
"card": "summary", // must be summary or player |
|
|
|
"card": "summary", // must be summary or player |
|
|
|
"creator": "", // @username of content creator |
|
|
|
"creator": config.twitter_user, // @username of content creator |
|
|
|
"description": "", // max 200 chars |
|
|
|
"description": og.description, // max 200 chars |
|
|
|
"image": "", // max 5mb image url 1:1 ratio |
|
|
|
"image": "", // max 5mb image url 1:1 ratio |
|
|
|
"image:alt": "", // max 420 chars image alt |
|
|
|
"image:alt": "", // max 420 chars image alt |
|
|
|
"site": "", // @username of site |
|
|
|
"site": config.twitter_user, // @username of site |
|
|
|
"title": "", // max 70 chars title |
|
|
|
"title": og.title, // max 70 chars title |
|
|
|
"player": "", // https url of player iframe |
|
|
|
"player": "", // https url of player iframe |
|
|
|
"player:width": "", // width iframe in pixels |
|
|
|
"player:width": "", // width iframe in pixels |
|
|
|
"player:height": "", // height iframe in pixels |
|
|
|
"player:height": "", // height iframe in pixels |
|
|
|
"player:stream": "", // URL to raw video/audio stream |
|
|
|
"player:stream": "", // URL to raw video/audio stream |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
export let language = "en"; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
export let json_ld = { |
|
|
|
|
|
|
|
"@context": "http://schema.org", |
|
|
|
|
|
|
|
"@type": "WebSite", |
|
|
|
|
|
|
|
"name": og.title, |
|
|
|
|
|
|
|
"url": og.url, |
|
|
|
|
|
|
|
"sameAs": [`https://twitter.com/${twitter.site}`], |
|
|
|
|
|
|
|
} |
|
|
|
</script> |
|
|
|
</script> |
|
|
|
|
|
|
|
|
|
|
|
<svelte:head> |
|
|
|
<svelte:head> |
|
|
|
|
|
|
|
<meta name="description" content={ og.description }> |
|
|
|
|
|
|
|
<!-- JSON-LD spec --> |
|
|
|
|
|
|
|
<script type="application/ld+json"> |
|
|
|
|
|
|
|
{ JSON.stringify(json_ld) } |
|
|
|
|
|
|
|
</script> |
|
|
|
|
|
|
|
|
|
|
|
<!--OG Spec for LinkedIn/Facebook/Others --> |
|
|
|
<!--OG Spec for LinkedIn/Facebook/Others --> |
|
|
|
{#each Object.keys(og) as key} |
|
|
|
{#each Object.keys(og) as key} |
|
|
|
<meta property="og:{ key }" content="{ og[key] }" /> |
|
|
|
<meta property="og:{ key }" content="{ og[key] }" /> |
|
|
@ -34,4 +52,7 @@ |
|
|
|
{#each Object.keys(twitter) as key} |
|
|
|
{#each Object.keys(twitter) as key} |
|
|
|
<meta name="twitter:{key}" content={ twitter[key] }/> |
|
|
|
<meta name="twitter:{key}" content={ twitter[key] }/> |
|
|
|
{/each} |
|
|
|
{/each} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<link rel="alternate" hreflang={ language } href={ og.url } /> |
|
|
|
|
|
|
|
<link rel="canonical" href={ og.url }/> |
|
|
|
</svelte:head> |
|
|
|
</svelte:head> |
|
|
|