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
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>