fix(frontend): fix meta tags

This commit is contained in:
Sam 2023-03-14 22:26:21 +01:00
parent dcf36465ea
commit c4d7acc3f6
No known key found for this signature in database
GPG Key ID: B4EF20DDE721CAA1
2 changed files with 9 additions and 7 deletions

View File

@ -234,7 +234,7 @@
{:else if data.bio && data.bio !== ""} {:else if data.bio && data.bio !== ""}
<meta <meta
property="og:description" property="og:description"
content="{data.bio.slice(0, 500)}${data.bio.length > 500 ? '…' : ''}" content="{data.bio.slice(0, 500)}{data.bio.length > 500 ? '…' : ''}"
/> />
{:else} {:else}
<meta property="og:description" content="@{data.name} on pronouns.cc" /> <meta property="og:description" content="@{data.name} on pronouns.cc" />

View File

@ -109,24 +109,26 @@
{#if favNames.length !== 0 && favPronouns.length !== 0} {#if favNames.length !== 0 && favPronouns.length !== 0}
<meta <meta
property="og:description" property="og:description"
content="{data.name} goes by {favNames.map((x) => x.value).join(', ')} and uses {favPronouns content="{data.display_name ?? data.name} goes by {favNames
.map((x) => pronounDisplay(x)) .map((x) => x.value)
.join(', ')} pronouns." .join(', ')} and uses {favPronouns.map((x) => pronounDisplay(x)).join(', ')} pronouns."
/> />
{:else if favNames.length !== 0} {:else if favNames.length !== 0}
<meta <meta
property="og:description" property="og:description"
content="{data.name} goes by {favNames.map((x) => x.value).join(', ')}." content="{data.display_name ?? data.name} goes by {favNames.map((x) => x.value).join(', ')}."
/> />
{:else if favPronouns.length !== 0} {:else if favPronouns.length !== 0}
<meta <meta
property="og:description" property="og:description"
content="{data.name} uses {favPronouns.map((x) => pronounDisplay(x)).join(', ')} pronouns." content="{data.display_name ?? data.name} uses {favPronouns
.map((x) => pronounDisplay(x))
.join(', ')} pronouns."
/> />
{:else if data.bio && data.bio !== ""} {:else if data.bio && data.bio !== ""}
<meta <meta
property="og:description" property="og:description"
content="{data.bio.slice(0, 500)}${data.bio.length > 500 ? '…' : ''}" content="{data.bio.slice(0, 500)}{data.bio.length > 500 ? '…' : ''}"
/> />
{:else} {:else}
<meta property="og:description" content="{data.name} (@{data.user.name}) on pronouns.cc" /> <meta property="og:description" content="{data.name} (@{data.user.name}) on pronouns.cc" />