feat: dynamically add socials to JSON-LD

This commit is contained in:
oSumAtrIX 2023-09-15 17:38:34 +02:00
parent e39632dc2e
commit aed3c7ca58
No known key found for this signature in database
GPG Key ID: A9B3094ACDB604B4
6 changed files with 12 additions and 45 deletions

View File

@ -1,5 +1,7 @@
<script lang="ts">
import { JsonLd } from 'svelte-meta-tags';
import { queries } from '$data/api';
import { createQuery } from '@tanstack/svelte-query';
let _title: string = '';
$: title = _title === '' ? 'ReVanced' : `ReVanced · ${_title}`;
@ -9,6 +11,11 @@
export let description: string = 'Continuing the legacy of Vanced.';
export let schema: any | undefined;
createQuery(['socials'], queries.socials).subscribe((query) => {
schema.publisher.sameAs = query.data?.socials?.map((social) => social.url);
});
</script>
<svelte:head>

View File

@ -20,15 +20,7 @@
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'
]
}
}
}}
/>

View File

@ -28,15 +28,7 @@
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'
]
}
}
}}
/>

View File

@ -54,15 +54,7 @@
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'
]
}
}
}}
/>

View File

@ -67,15 +67,7 @@
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'
]
}
}
}}
/>

View File

@ -122,15 +122,7 @@
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'
]
}
}
}}
/>