mirror of
https://github.com/ditatompel/xmr-remote-nodes.git
synced 2025-04-09 21:16:28 +07:00
Removing meta OG:Image and article
This commit is contained in:
parent
2a4721b8de
commit
a2669c558f
6 changed files with 13 additions and 75 deletions
|
@ -2,7 +2,6 @@
|
||||||
// import { writable } from 'svelte/store';
|
// import { writable } from 'svelte/store';
|
||||||
import { page } from '$app/stores';
|
import { page } from '$app/stores';
|
||||||
import { computePosition, autoUpdate, offset, shift, flip, arrow } from '@floating-ui/dom';
|
import { computePosition, autoUpdate, offset, shift, flip, arrow } from '@floating-ui/dom';
|
||||||
import { beforeNavigate, afterNavigate } from '$app/navigation';
|
|
||||||
import '../../app.css';
|
import '../../app.css';
|
||||||
import {
|
import {
|
||||||
Toast,
|
Toast,
|
||||||
|
@ -24,96 +23,57 @@
|
||||||
title: 'Monero is private, decentralized cryptocurrency that keeps your finances confidential and secure.',
|
title: 'Monero is private, decentralized cryptocurrency that keeps your finances confidential and secure.',
|
||||||
description: '',
|
description: '',
|
||||||
keywords: '',
|
keywords: '',
|
||||||
image:
|
|
||||||
'https://vcl-og-img.ditatompel.com/' +
|
|
||||||
encodeURIComponent('Monero is private, decentralized cryptocurrency that keeps your finances confidential and secure.') +
|
|
||||||
'.png?md=0'
|
|
||||||
};
|
};
|
||||||
const meta = {
|
const meta = {
|
||||||
title: metaDefaults.title,
|
title: metaDefaults.title,
|
||||||
description: metaDefaults.description,
|
description: metaDefaults.description,
|
||||||
keywords: metaDefaults.keywords,
|
keywords: metaDefaults.keywords,
|
||||||
image: metaDefaults.image,
|
|
||||||
article: { publishTime: '', modifiedTime: '', author: '' },
|
|
||||||
// Twitter
|
// Twitter
|
||||||
twitter: {
|
twitter: {
|
||||||
title: metaDefaults.title,
|
title: metaDefaults.title,
|
||||||
description: metaDefaults.description,
|
description: metaDefaults.description
|
||||||
image: metaDefaults.image
|
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
page.subscribe((page) => {
|
page.subscribe((page) => {
|
||||||
// Restore Page Defaults
|
|
||||||
meta.title = metaDefaults.title;
|
meta.title = metaDefaults.title;
|
||||||
meta.description = metaDefaults.description;
|
meta.description = metaDefaults.description;
|
||||||
meta.keywords = metaDefaults.keywords;
|
meta.keywords = metaDefaults.keywords;
|
||||||
meta.image = metaDefaults.image;
|
|
||||||
// Restore Twitter Defaults
|
|
||||||
meta.twitter.title = metaDefaults.title;
|
meta.twitter.title = metaDefaults.title;
|
||||||
meta.twitter.description = metaDefaults.description;
|
meta.twitter.description = metaDefaults.description;
|
||||||
meta.twitter.image = metaDefaults.image;
|
|
||||||
if (typeof page.data.meta === 'object') {
|
if (typeof page.data.meta === 'object') {
|
||||||
meta.title = page.data.meta.title ?? metaDefaults.title;
|
meta.title = page.data.meta.title ?? metaDefaults.title;
|
||||||
meta.description = page.data.meta.description ?? metaDefaults.description;
|
meta.description = page.data.meta.description ?? metaDefaults.description;
|
||||||
meta.keywords = page.data.meta.keywords ?? metaDefaults.description;
|
meta.keywords = page.data.meta.keywords ?? metaDefaults.description;
|
||||||
meta.image = page.data.meta.image ?? metaDefaults.image;
|
|
||||||
// Restore Twitter Defaults
|
|
||||||
meta.twitter.title = page.data.meta.title ?? metaDefaults.title;
|
meta.twitter.title = page.data.meta.title ?? metaDefaults.title;
|
||||||
meta.twitter.description = page.data.meta.description ?? metaDefaults.description;
|
meta.twitter.description = page.data.meta.description ?? metaDefaults.description;
|
||||||
meta.twitter.image = page.data.meta.image ?? metaDefaults.description;
|
|
||||||
if (typeof page.data.meta.article === 'object') {
|
|
||||||
meta.article.author = page.data.meta.article.author ?? '';
|
|
||||||
}
|
}
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
let isLoading = false;
|
|
||||||
|
|
||||||
// progress bar show
|
|
||||||
beforeNavigate(() => (isLoading = true));
|
|
||||||
|
|
||||||
// scroll to top after nafigation and progress bar
|
|
||||||
afterNavigate((/* params */) => {
|
|
||||||
isLoading = false;
|
|
||||||
// scroll to top when navigate
|
|
||||||
// const isNewPage = params.from?.url.pathname !== params.to?.url.pathname;
|
|
||||||
// const elemPage = document.querySelector('#page');
|
|
||||||
// if (isNewPage && elemPage !== null) {
|
|
||||||
// elemPage.scrollTop = 0;
|
|
||||||
// }
|
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<svelte:head>
|
<svelte:head>
|
||||||
<title>{meta.title} — xmr.ditatompel.com</title>
|
<title>{meta.title} — xmr.ditatompel.com</title>
|
||||||
<!-- Meta Tags -->
|
<!-- Meta Tags -->
|
||||||
<meta name="title" content="{meta.title} — ditatompel.com" />
|
<meta name="title" content="{meta.title} — xmr.ditatompel.com" />
|
||||||
<meta name="description" content={meta.description} />
|
<meta name="description" content={meta.description} />
|
||||||
<meta name="keywords" content={meta.keywords} />
|
<meta name="keywords" content={meta.keywords} />
|
||||||
<meta name="theme-color" content="#272b31" />
|
<meta name="theme-color" content="#272b31" />
|
||||||
<meta name="author" content="ditatompel" />
|
<meta name="author" content="ditatompel" />
|
||||||
|
|
||||||
<!-- Open Graph - https://ogp.me/ -->
|
<!-- Open Graph - https://ogp.me/ -->
|
||||||
<meta property="og:site_name" content="ditatompel.com" />
|
<meta property="og:site_name" content="xmr.ditatompel.com" />
|
||||||
<meta property="og:type" content="website" />
|
<meta property="og:type" content="website" />
|
||||||
<meta property="og:url" content="https://www.ditatompel.com{$page.url.pathname}" />
|
<meta property="og:url" content="https://xmr.ditatompel.com{$page.url.pathname}" />
|
||||||
<meta property="og:locale" content="en_US" />
|
<meta property="og:locale" content="en_US" />
|
||||||
<meta property="og:title" content="{meta.title} — ditatompel.com" />
|
<meta property="og:title" content="{meta.title} — xmr.ditatompel.com" />
|
||||||
<meta property="og:description" content={meta.description} />
|
<meta property="og:description" content={meta.description} />
|
||||||
<meta property="og:image" content={meta.image} />
|
|
||||||
<meta property="og:image:secure_url" content={meta.image} />
|
|
||||||
<meta property="og:image:type" content="image/png" />
|
|
||||||
<meta property="og:image:width" content="2048" />
|
|
||||||
<meta property="og:image:height" content="1170" />
|
|
||||||
|
|
||||||
<!-- Open Graph: Twitter -->
|
<!-- Open Graph: Twitter -->
|
||||||
<meta name="twitter:card" content="summary" />
|
<meta name="twitter:card" content="summary" />
|
||||||
<meta name="twitter:site" content="@ditatompel" />
|
<meta name="twitter:site" content="@ditatompel" />
|
||||||
<meta name="twitter:creator" content="@ditatompel" />
|
<meta name="twitter:creator" content="@ditatompel" />
|
||||||
<meta name="twitter:title" content="{meta.twitter.title} — ditatompel.com" />
|
<meta name="twitter:title" content="{meta.twitter.title} — xmr.ditatompel.com" />
|
||||||
<meta name="twitter:description" content={meta.twitter.description} />
|
<meta name="twitter:description" content={meta.twitter.description} />
|
||||||
<meta name="twitter:image" content={meta.twitter.image} />
|
|
||||||
</svelte:head>
|
</svelte:head>
|
||||||
|
|
||||||
<Modal />
|
<Modal />
|
||||||
|
|
|
@ -12,15 +12,10 @@ export async function load({ data }) {
|
||||||
title: metaDefaults.title,
|
title: metaDefaults.title,
|
||||||
description: metaDefaults.description,
|
description: metaDefaults.description,
|
||||||
keywords: metaDefaults.keywords,
|
keywords: metaDefaults.keywords,
|
||||||
image:
|
|
||||||
'https://vcl-og-img.ditatompel.com/' + encodeURIComponent(metaDefaults.title) + '.png?md=0',
|
|
||||||
// Article
|
|
||||||
article: { publishTime: '', modifiedTime: '', author: '' },
|
|
||||||
// Twitter
|
// Twitter
|
||||||
twitter: {
|
twitter: {
|
||||||
title: metaDefaults.title,
|
title: metaDefaults.title,
|
||||||
description: metaDefaults.description,
|
description: metaDefaults.description
|
||||||
image: metaDefaults.image
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
|
@ -12,15 +12,10 @@ export async function load({ data }) {
|
||||||
title: metaDefaults.title,
|
title: metaDefaults.title,
|
||||||
description: metaDefaults.description,
|
description: metaDefaults.description,
|
||||||
keywords: metaDefaults.keywords,
|
keywords: metaDefaults.keywords,
|
||||||
image:
|
|
||||||
'https://vcl-og-img.ditatompel.com/' + encodeURIComponent(metaDefaults.title) + '.png?md=0',
|
|
||||||
// Article
|
|
||||||
article: { publishTime: '', modifiedTime: '', author: '' },
|
|
||||||
// Twitter
|
// Twitter
|
||||||
twitter: {
|
twitter: {
|
||||||
title: metaDefaults.title,
|
title: metaDefaults.title,
|
||||||
description: metaDefaults.description,
|
description: metaDefaults.description
|
||||||
image: metaDefaults.image
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
|
@ -12,16 +12,11 @@ export async function load({ data }) {
|
||||||
title: metaDefaults.title,
|
title: metaDefaults.title,
|
||||||
description: metaDefaults.description,
|
description: metaDefaults.description,
|
||||||
keywords: metaDefaults.keywords,
|
keywords: metaDefaults.keywords,
|
||||||
image:
|
|
||||||
'https://vcl-og-img.ditatompel.com/' + encodeURIComponent(metaDefaults.title) + '.png?md=0',
|
|
||||||
// Article
|
|
||||||
article: { publishTime: '', modifiedTime: '', author: '' },
|
|
||||||
// Twitter
|
// Twitter
|
||||||
twitter: {
|
twitter: {
|
||||||
title: metaDefaults.title,
|
title: metaDefaults.title,
|
||||||
description: metaDefaults.description,
|
description: metaDefaults.description
|
||||||
image: metaDefaults.image
|
}
|
||||||
}
|
}
|
||||||
},
|
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
|
@ -7,22 +7,16 @@ export async function load({ data }) {
|
||||||
keywords: 'monero,xmr,monero node,xmrnode,cryptocurrency'
|
keywords: 'monero,xmr,monero node,xmrnode,cryptocurrency'
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
return {
|
return {
|
||||||
meta: {
|
meta: {
|
||||||
title: metaDefaults.title,
|
title: metaDefaults.title,
|
||||||
description: metaDefaults.description,
|
description: metaDefaults.description,
|
||||||
keywords: metaDefaults.keywords,
|
keywords: metaDefaults.keywords,
|
||||||
image:
|
|
||||||
'https://vcl-og-img.ditatompel.com/' + encodeURIComponent(metaDefaults.title) + '.png?md=0',
|
|
||||||
// Article
|
|
||||||
article: { publishTime: '', modifiedTime: '', author: '' },
|
|
||||||
// Twitter
|
// Twitter
|
||||||
twitter: {
|
twitter: {
|
||||||
title: metaDefaults.title,
|
title: metaDefaults.title,
|
||||||
description: metaDefaults.description,
|
description: metaDefaults.description
|
||||||
image: metaDefaults.image
|
}
|
||||||
}
|
}
|
||||||
},
|
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
|
@ -19,7 +19,7 @@
|
||||||
// progress bar show
|
// progress bar show
|
||||||
beforeNavigate(() => (isLoading = true));
|
beforeNavigate(() => (isLoading = true));
|
||||||
|
|
||||||
afterNavigate((/* params */) => {
|
afterNavigate(() => {
|
||||||
isLoading = false;
|
isLoading = false;
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
|
@ -33,4 +33,3 @@
|
||||||
/>
|
/>
|
||||||
{/if}
|
{/if}
|
||||||
<slot />
|
<slot />
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue