Skip to content

Commit

Permalink
fix: Use correct rich results schemas
Browse files Browse the repository at this point in the history
  • Loading branch information
oSumAtrIX committed Nov 11, 2023
1 parent c5d1421 commit d0912a2
Show file tree
Hide file tree
Showing 7 changed files with 186 additions and 95 deletions.
19 changes: 7 additions & 12 deletions src/lib/components/Meta.svelte
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
<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}`;
Expand All @@ -10,12 +8,7 @@
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);
});
export let schemas: any[] | undefined;
</script>

<svelte:head>
Expand All @@ -27,15 +20,17 @@
<meta property="og:title" content={title} />
<meta property="og:description" content={description} />
<meta property="og:type" content="website" />
<meta property="og:image" content="/embed.png" />
<meta property="og:image" content="/logo.png" />

<!-- Twitter -->
<meta name="twitter:title" content={title} />
<meta name="twitter:description" content={description} />
<meta name="twitter:image" itemprop="image" content="/embed.png" />
<meta name="twitter:image" itemprop="image" content="/logo.png" />
<meta name="twitter:card" content="summary" />

{#if schema}
<JsonLd {schema} />
{#if schemas}
{#each schemas as schema}
<JsonLd {schema} />
{/each}
{/if}
</svelte:head>
116 changes: 104 additions & 12 deletions src/routes/+page.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -7,22 +7,114 @@
</script>

<Meta
schema={{
'@context': 'https://schema.org',
'@type': 'WebPage',
name: 'ReVanced',
abstract: 'Continuing the legacy of Vanced',
breadcrumb: 'Home',
publisher: {
schemas={[
{
'@context': 'https://schema.org',
'@type': 'Organization',
name: 'ReVanced',
url: 'https://revanced.app/',
logo: {
'@type': 'ImageObject',
url: 'https://revanced.app/embed.png'
logo: 'https://revanced.app/logo.png'
},
{
'@context': 'https://schema.org',
'@type': 'BreadcrumbList',
itemListElement: [
{
'@type': 'ListItem',
position: 1,
name: 'Home',
item: 'https://revanced.app/'
}
]
},
{
'@context': 'https://schema.org',
'@type': 'FAQPage',
mainEntity: [
{
'@type': 'Question',
name: 'What is ReVanced?',
acceptedAnswer: {
'@type': 'Answer',
text: 'ReVanced is an <b>open-source patcher</b> for <b>Android apps</b>. With ReVanced we <b>continue the legacy of Vanced</b>.'
}
},
{
'@type': 'Question',
name: 'How to get ReVanced?',
acceptedAnswer: {
'@type': 'Answer',
text: 'You can follow <a href="https://github.com/revanced/revanced-manager/tree/main/docs">ReVanced Manager documentation</a> to use <b>ReVanced Manager</b> or the <a href="https://github.com/revanced/revanced-cli/tree/main/docs">ReVanced CLI documentation</a> to use <b>ReVanced CLI</b>.'
}
},
{
'@type': 'Question',
name: 'How does it work?',
acceptedAnswer: {
'@type': 'Answer',
text: 'ReVanced uses a technique called <b>patching</b>. It patches <b>your choice of an app</b> and adds <b>new features</b> to it. Thanks to the <b>modularity of ReVanced</b>, you can choose <b>any combination of features you want</b> to use.'
}
},
{
'@type': 'Question',
name: 'Does ReVanced support non-rooted devices?',
acceptedAnswer: {
'@type': 'Answer',
text: '<b>Yes</b>! ReVanced supports <b>non-root and rooted devices</b>.'
}
},
{
'@type': 'Question',
name: 'Is ReVanced affiliated with Vanced?',
acceptedAnswer: {
'@type': 'Answer',
text: 'ReVanced is <b>not affiliated</b> with Vanced.'
}
},
{
'@type': 'Question',
name: 'How can I help?',
acceptedAnswer: {
'@type': 'Answer',
text: 'Since we are an <b>open-source community</b> and depend on outside help, you can always check out our <a href="https://github.com/revanced">GitHub repositories</a> and <b>contribute to ReVanced</b> by creating an issue or pull requests.'
}
}
]
},
{
'@context': 'https://schema.org',
'@type': 'SoftwareApplication',
name: 'ReVanced Manager',
operatingSystem: 'ANDROID',
applicationCategory: 'UtilitiesApplication',
aggregateRating: {
'@type': 'AggregateRating',
ratingValue: '4.0',
ratingCount: '100'
},
offers: {
'@type': 'Offer',
price: '0',
priceCurrency: 'USD'
}
},
{
'@context': 'https://schema.org',
'@type': 'SoftwareApplication',
name: 'ReVanced CLI',
operatingSystem: 'All',
applicationCategory: 'UtilitiesApplication',
aggregateRating: {
'@type': 'AggregateRating',
ratingValue: '4.0',
ratingCount: '30'
},
offers: {
'@type': 'Offer',
price: '0',
priceCurrency: 'USD'
}
}
}}
]}
/>

<main>
Expand Down
35 changes: 19 additions & 16 deletions src/routes/contributors/+page.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -14,23 +14,26 @@
</script>

<Meta
title="Contributors"
schema={{
'@context': 'https://schema.org',
'@type': 'WebPage',
name: 'ReVanced Contributors',
abstract: 'A list of everyone that has contributed to ReVanced',
breadcrumb: 'Home > Contributors',
publisher: {
'@type': 'Organization',
name: 'ReVanced',
url: 'https://revanced.app/',
logo: {
'@type': 'ImageObject',
url: 'https://revanced.app/embed.png'
}
schemas={[
{
'@context': 'https://schema.org',
'@type': 'BreadcrumbList',
itemListElement: [
{
'@type': 'ListItem',
position: 1,
name: 'Home',
item: 'https://revanced.app/'
},
{
'@type': 'ListItem',
position: 2,
name: 'Contributors',
item: 'https://revanced.app/contributors'
}
]
}
}}
]}
/>

<main>
Expand Down
32 changes: 18 additions & 14 deletions src/routes/donate/+page.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -41,20 +41,24 @@

<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'
}
schemas={{
{
'@context': 'https://schema.org',
'@type': 'BreadcrumbList',
itemListElement: [
{
'@type': 'ListItem',
position: 1,
name: 'Home',
item: 'https://revanced.app/'
},
{
'@type': 'ListItem',
position: 2,
name: 'Download',
item: 'https://revanced.app/donate'
}
]
}
}}
/>
Expand Down
44 changes: 19 additions & 25 deletions src/routes/download/+page.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -44,32 +44,26 @@
</script>

<Meta
title="Download"
schema={{
'@type': 'MobileApplication',
name: 'ReVanced Manager',
description:
'ReVanced Manager is an Android application that uses ReVanced Patcher to add, remove, and modify existing functionalities in Android applications',
abstract: 'Continuing the legacy of Vanced',
applicationCategory: 'UtilitiesApplication',
applicationSuite: 'ReVanced',
downloadUrl: 'https://revanced.app/download',
maintainer: 'ReVanced',
operatingSystem: 'Android 8',
offers: {
'@type': 'Offer',
price: '0'
},
publisher: {
'@type': 'Organization',
name: 'ReVanced',
url: 'https://revanced.app/',
logo: {
'@type': 'ImageObject',
url: 'https://revanced.app/embed.png'
}
schemas={[
{
'@context': 'https://schema.org',
'@type': 'BreadcrumbList',
itemListElement: [
{
'@type': 'ListItem',
position: 1,
name: 'Home',
item: 'https://revanced.app/'
},
{
'@type': 'ListItem',
position: 2,
name: 'Download',
item: 'https://revanced.app/download'
}
]
}
}}
]}
/>

<Dialogue bind:modalOpen={warningDialogue}>
Expand Down
35 changes: 19 additions & 16 deletions src/routes/patches/+page.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -108,23 +108,26 @@
</script>

<Meta
title="Patches"
schema={{
'@context': 'https://schema.org',
'@type': 'WebPage',
name: 'ReVanced Patches',
abstract: 'A list of ReVanced Patches',
breadcrumb: 'Home > Patches',
publisher: {
'@type': 'Organization',
name: 'ReVanced',
url: 'https://revanced.app/',
logo: {
'@type': 'ImageObject',
url: 'https://revanced.app/embed.png'
}
schemas={[
{
'@context': 'https://schema.org',
'@type': 'BreadcrumbList',
itemListElement: [
{
'@type': 'ListItem',
position: 1,
name: 'Home',
item: 'https://revanced.app/'
},
{
'@type': 'ListItem',
position: 2,
name: 'Patches',
item: 'https://revanced.app/patches'
}
]
}
}}
]}
/>

<div class="search">
Expand Down
File renamed without changes

0 comments on commit d0912a2

Please sign in to comment.