Something went wrong. Try again.
Monorepo for Tangled
Something went wrong. Try again.
Svelte
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768<script lang="ts"> interface Props { title?: string; description?: string; canonical?: string; type?: "website" | "profile" | "article"; card?: "summary" | "summary_large_image"; image?: string; noindex?: boolean; jsonLd?: Record<string, unknown> | Array<Record<string, unknown>>; }
let { title, description, canonical, type = "website", card = "summary_large_image", image, noindex = false, jsonLd }: Props = $props();
const fullTitle = $derived( title ? title.includes("·") || title.includes("·") ? title : `${title} · Tangled` : undefined );
const schemas = $derived(jsonLd ? (Array.isArray(jsonLd) ? jsonLd : [jsonLd]) : []);</script>
<svelte:head> {#if fullTitle} <title>{fullTitle}</title> <meta property="og:title" content={fullTitle} /> <meta name="twitter:title" content={fullTitle} /> {/if} {#if description} <meta name="description" content={description} /> <meta property="og:description" content={description} /> <meta name="twitter:description" content={description} /> {/if} {#if canonical} <link rel="canonical" href={canonical} /> <meta property="og:url" content={canonical} /> {/if} {#if type} <meta property="og:type" content={type} /> {/if} {#if card} <meta name="twitter:card" content={card} /> {/if} <meta property="og:image" content={image || "https://assets.tangled.network/tangled_og.png"} /> <meta property="og:image:width" content="1200" /> <meta property="og:image:height" content="630" /> <meta name="twitter:image" content={image || "https://assets.tangled.network/tangled_og.png"} /> {#if noindex} <meta name="robots" content="noindex, nofollow" /> {/if} {#each schemas as schema (schema)} <!-- eslint-disable-next-line svelte/no-at-html-tags -- json-ld must be emitted as a script tag --> {@html `<script type="application/ld+json">${JSON.stringify(schema)}<` + `/script>`} {/each}</svelte:head>