mirror of
https://github.com/whoswhip/Sharpbin.git
synced 2026-12-06 02:48:43 +00:00
fix: normalize cononical
This commit is contained in:
@@ -100,6 +100,9 @@
|
|||||||
let highlightRequestId = 0;
|
let highlightRequestId = 0;
|
||||||
let ignoreExternalMediaWarning = false;
|
let ignoreExternalMediaWarning = false;
|
||||||
let iconsOnly = $state(false);
|
let iconsOnly = $state(false);
|
||||||
|
const canonicalUrl = $derived(
|
||||||
|
data.paste ? new URL(`/${data.paste.id}`, data.url).href : undefined
|
||||||
|
);
|
||||||
|
|
||||||
let scrollY = $state(0);
|
let scrollY = $state(0);
|
||||||
|
|
||||||
@@ -590,14 +593,14 @@
|
|||||||
name="robots"
|
name="robots"
|
||||||
content={data.paste.visibility === 0 ? 'index, follow' : 'noindex, nofollow'}
|
content={data.paste.visibility === 0 ? 'index, follow' : 'noindex, nofollow'}
|
||||||
/>
|
/>
|
||||||
<link rel="canonical" href={data.url} />
|
<link rel="canonical" href={canonicalUrl} />
|
||||||
{#if data.paste.author}
|
{#if data.paste.author}
|
||||||
<meta name="author" content={data.paste.author.username} />
|
<meta name="author" content={data.paste.author.username} />
|
||||||
{/if}
|
{/if}
|
||||||
<meta property="og:title" content={data.paste.title || 'Untitled Paste'} />
|
<meta property="og:title" content={data.paste.title || 'Untitled Paste'} />
|
||||||
<meta property="og:description" content={pasteDescription} />
|
<meta property="og:description" content={pasteDescription} />
|
||||||
<meta property="og:type" content="article" />
|
<meta property="og:type" content="article" />
|
||||||
<meta property="og:url" content={data.url} />
|
<meta property="og:url" content={canonicalUrl} />
|
||||||
<meta property="og:site_name" content="Sharpbin" />
|
<meta property="og:site_name" content="Sharpbin" />
|
||||||
{#if pasteImageUrl}
|
{#if pasteImageUrl}
|
||||||
<meta property="og:image" content={pasteImageUrl} />
|
<meta property="og:image" content={pasteImageUrl} />
|
||||||
|
|||||||
Reference in New Issue
Block a user