fix: Move JSON-LD scripts to head nodes

This commit is contained in:
oSumAtrIX 2023-09-15 17:19:44 +02:00
parent f1e8fd0651
commit e39632dc2e
No known key found for this signature in database
GPG Key ID: A9B3094ACDB604B4
7 changed files with 57 additions and 27 deletions

View File

@ -1,10 +1,14 @@
<script lang="ts"> <script lang="ts">
let _title: string = ""; import { JsonLd } from 'svelte-meta-tags';
$: title = _title === "" ? "ReVanced" : `ReVanced · ${_title}`;
export { _title as title }; let _title: string = '';
$: title = _title === '' ? 'ReVanced' : `ReVanced · ${_title}`;
export let description: string = "Continuing the legacy of Vanced."; export { _title as title };
export let description: string = 'Continuing the legacy of Vanced.';
export let schema: any | undefined;
</script> </script>
<svelte:head> <svelte:head>
@ -23,4 +27,8 @@ export let description: string = "Continuing the legacy of Vanced.";
<meta name="twitter:description" content={description} /> <meta name="twitter:description" content={description} />
<meta name="twitter:image" itemprop="image" content="/embed.png" /> <meta name="twitter:image" itemprop="image" content="/embed.png" />
<meta name="twitter:card" content="summary" /> <meta name="twitter:card" content="summary" />
{#if schema}
<JsonLd {schema} />
{/if}
</svelte:head> </svelte:head>

View File

@ -1,6 +1,5 @@
<script lang="ts"> <script lang="ts">
import Meta from '$lib/components/Meta.svelte'; import Meta from '$lib/components/Meta.svelte';
import Navigation from '$layout/Navbar/NavButton.svelte';
import { page } from '$app/stores'; import { page } from '$app/stores';
import Button from '$lib/components/Button.svelte'; import Button from '$lib/components/Button.svelte';

View File

@ -4,12 +4,9 @@
import SocialHost from '$layout/Hero/SocialHost.svelte'; import SocialHost from '$layout/Hero/SocialHost.svelte';
import Wave from '$lib/components/Wave.svelte'; import Wave from '$lib/components/Wave.svelte';
import Meta from '$lib/components/Meta.svelte'; import Meta from '$lib/components/Meta.svelte';
import { JsonLd } from 'svelte-meta-tags';
</script> </script>
<Meta /> <Meta
<JsonLd
schema={{ schema={{
'@context': 'https://schema.org', '@context': 'https://schema.org',
'@type': 'WebPage', '@type': 'WebPage',

View File

@ -5,7 +5,6 @@
import ContributorHost from './ContributorSection.svelte'; import ContributorHost from './ContributorSection.svelte';
import Footer from '$layout/Footer/FooterHost.svelte'; import Footer from '$layout/Footer/FooterHost.svelte';
import Meta from '$lib/components/Meta.svelte'; import Meta from '$lib/components/Meta.svelte';
import { JsonLd } from 'svelte-meta-tags';
import Query from '$lib/components/Query.svelte'; import Query from '$lib/components/Query.svelte';
import { queries } from '$data/api'; import { queries } from '$data/api';
@ -14,8 +13,8 @@
const query = createQuery(['repositories'], queries.repositories); const query = createQuery(['repositories'], queries.repositories);
</script> </script>
<Meta title="Contributors" /> <Meta
<JsonLd title="Contributors"
schema={{ schema={{
'@context': 'https://schema.org', '@context': 'https://schema.org',
'@type': 'WebPage', '@type': 'WebPage',

View File

@ -39,7 +39,33 @@
} }
</script> </script>
<Meta title="Donate" /> <Meta
title="Donate"
schema={{
'@context': 'https://schema.org',
'@type': 'WebPage',
name: 'ReVanced Donation',
abstract: 'Various ways to support ReVanced',
breadcrumb: 'Home > Donate',
publisher: {
'@type': 'Organization',
name: 'ReVanced',
url: 'https://revanced.app/',
logo: {
'@type': 'ImageObject',
url: 'https://revanced.app/embed.png'
},
sameAs: [
'https://github.com/revanced',
'https://twitter.com/revancedapp',
'https://revanced.app/discord',
'https://www.reddit.com/r/revancedapp',
'https://t.me/app_revanced',
'https://www.youtube.com/@ReVanced'
]
}
}}
/>
<main class="wrapper" in:fly={{ y: 10, easing: quintOut, duration: 750 }}> <main class="wrapper" in:fly={{ y: 10, easing: quintOut, duration: 750 }}>
<section> <section>
@ -67,11 +93,12 @@
<a class="donate-card" target="_blank" rel="noreferrer" href={platform.url}> <a class="donate-card" target="_blank" rel="noreferrer" href={platform.url}>
<!-- not using <img/> because we want the image height to always be 200px --> <!-- not using <img/> because we want the image height to always be 200px -->
<div <div
style="background-image: url('/donate/card-images/{platform.name}.{supportsWebP() ? 'webp' : 'png'}'), url('/donate/card-images/fallback.svg');" style="background-image: url('/donate/card-images/{platform.name}.{supportsWebP()
? 'webp'
: 'png'}'), url('/donate/card-images/fallback.svg');"
role="img" role="img"
aria-label="{platform.name} preview image" aria-label="{platform.name} preview image"
> />
</div>
<span>{platform.name}</span> <span>{platform.name}</span>
</a> </a>
{/each} {/each}
@ -79,7 +106,9 @@
{#if data.wallets} {#if data.wallets}
<button class="donate-card" on:click={() => (cryptoDialogue = !cryptoDialogue)}> <button class="donate-card" on:click={() => (cryptoDialogue = !cryptoDialogue)}>
<div <div
style="background-image: url('/donate/card-images/Cryptocurrencies.{supportsWebP() ? 'webp' : 'png'}'), url('/donate/card-images/fallback.svg');" style="background-image: url('/donate/card-images/Cryptocurrencies.{supportsWebP()
? 'webp'
: 'png'}'), url('/donate/card-images/fallback.svg');"
role="img" role="img"
aria-label="Cryptocurrencies preview image" aria-label="Cryptocurrencies preview image"
/> />
@ -209,7 +238,6 @@
} }
} }
// COPEEEE // COPEEEE
@media screen and (max-width: 768px) { @media screen and (max-width: 768px) {
#heart { #heart {

View File

@ -8,7 +8,6 @@
import manager_screenshot from '$images/manager.png?format=avif;webp;png&picture'; import manager_screenshot from '$images/manager.png?format=avif;webp;png&picture';
import Meta from '$lib/components/Meta.svelte'; import Meta from '$lib/components/Meta.svelte';
import { JsonLd } from 'svelte-meta-tags';
import Query from '$lib/components/Query.svelte'; import Query from '$lib/components/Query.svelte';
import Button from '$lib/components/Button.svelte'; import Button from '$lib/components/Button.svelte';
import Footer from '$layout/Footer/FooterHost.svelte'; import Footer from '$layout/Footer/FooterHost.svelte';
@ -44,8 +43,8 @@
} }
</script> </script>
<Meta title="Download" /> <Meta
<JsonLd title="Download"
schema={{ schema={{
'@type': 'MobileApplication', '@type': 'MobileApplication',
name: 'ReVanced Manager', name: 'ReVanced Manager',

View File

@ -107,8 +107,8 @@
}; };
</script> </script>
<Meta title="Patches" /> <Meta
<JsonLd title="Patches"
schema={{ schema={{
'@context': 'https://schema.org', '@context': 'https://schema.org',
'@type': 'WebPage', '@type': 'WebPage',