feat: add schema org

This commit is contained in:
xHyroM 2023-04-01 11:39:51 +02:00
parent 61c8a2ccdb
commit beca04f271
No known key found for this signature in database
GPG key ID: BE0423F386C436AA
2 changed files with 22 additions and 9 deletions

View file

@ -11,7 +11,6 @@ import { SITE, OPEN_GRAPH } from "../config";
<!-- Open Graph / Facebook --> <!-- Open Graph / Facebook -->
<meta property="og:type" content="website" /> <meta property="og:type" content="website" />
<meta property="og:url" content={SITE.url} /> <meta property="og:url" content={SITE.url} />
<meta property="og:site_name" content={SITE.title} />
<meta property="og:title" content={SITE.title} /> <meta property="og:title" content={SITE.title} />
<meta property="og:description" content={SITE.description} /> <meta property="og:description" content={SITE.description} />
<meta property="og:image" content={OPEN_GRAPH.image.src} /> <meta property="og:image" content={OPEN_GRAPH.image.src} />
@ -27,3 +26,6 @@ import { SITE, OPEN_GRAPH } from "../config";
<meta name="twitter:image:alt" content={OPEN_GRAPH.image.alt} /> <meta name="twitter:image:alt" content={OPEN_GRAPH.image.alt} />
<meta name="theme-color" content={SITE.themeColor} /> <meta name="theme-color" content={SITE.themeColor} />
<script type="application/ld+json" set:html={JSON.stringify(SITE.schema)}
></script>

View file

@ -1,11 +1,3 @@
export const SITE = {
title: "Hyro's Links",
description:
"Hyro's Links is a website that contains links to my social media accounts and other useful links.",
url: "https://links.xhyrom.me",
themeColor: "#fbc119",
};
export const OPEN_GRAPH = { export const OPEN_GRAPH = {
image: { image: {
src: "og_image.png", src: "og_image.png",
@ -56,3 +48,22 @@ export const BUTTONS = [
href: "https://reddit.com/u/xHyroM", href: "https://reddit.com/u/xHyroM",
}, },
]; ];
export const SITE = {
title: "Hyro's Links",
description:
"Hyro's Links is a website that contains links to my social media accounts and other useful links.",
url: "https://links.xhyrom.me",
themeColor: "#fbc119",
schema: {
"@context": "https://schema.org/",
"@type": "ItemList",
name: "Redirects",
itemListElement: BUTTONS.map((button, i) => ({
"@type": "ListItem",
position: i + 1,
name: button.name,
url: button.href,
})),
},
};