|
| 1 | +import { getTranslations } from "next-intl/server" |
| 2 | + |
| 3 | +import { FileContributor } from "@/lib/types" |
| 4 | + |
| 5 | +import PageJsonLD from "@/components/PageJsonLD" |
| 6 | + |
| 7 | +import { normalizeUrlForJsonLd } from "@/lib/utils/url" |
| 8 | + |
| 9 | +export default async function TenYearJsonLD({ |
| 10 | + locale, |
| 11 | + contributors, |
| 12 | +}: { |
| 13 | + locale: string |
| 14 | + contributors: FileContributor[] |
| 15 | +}) { |
| 16 | + const t = await getTranslations({ |
| 17 | + namespace: "page-10-year-anniversary", |
| 18 | + }) |
| 19 | + |
| 20 | + const url = normalizeUrlForJsonLd(locale, "/10years/") |
| 21 | + |
| 22 | + const contributorList = contributors.map((contributor) => ({ |
| 23 | + "@type": "Person", |
| 24 | + name: contributor.login, |
| 25 | + url: contributor.html_url, |
| 26 | + })) |
| 27 | + |
| 28 | + const webPageJsonLd = { |
| 29 | + "@context": "https://schema.org", |
| 30 | + "@type": "WebPage", |
| 31 | + "@id": url, |
| 32 | + name: t("page-10-year-anniversary-meta-title"), |
| 33 | + description: t("page-10-year-anniversary-meta-description"), |
| 34 | + url: url, |
| 35 | + inLanguage: locale, |
| 36 | + author: [ |
| 37 | + { |
| 38 | + "@type": "Organization", |
| 39 | + name: "ethereum.org", |
| 40 | + url: "https://ethereum.org", |
| 41 | + }, |
| 42 | + ], |
| 43 | + contributor: contributorList, |
| 44 | + breadcrumb: { |
| 45 | + "@type": "BreadcrumbList", |
| 46 | + itemListElement: [ |
| 47 | + { |
| 48 | + "@type": "ListItem", |
| 49 | + position: 1, |
| 50 | + name: "Home", |
| 51 | + item: normalizeUrlForJsonLd(locale, "/"), |
| 52 | + }, |
| 53 | + { |
| 54 | + "@type": "ListItem", |
| 55 | + position: 2, |
| 56 | + name: t("page-10-year-anniversary-meta-title"), |
| 57 | + item: url, |
| 58 | + }, |
| 59 | + ], |
| 60 | + }, |
| 61 | + publisher: { |
| 62 | + "@type": "Organization", |
| 63 | + name: "ethereum.org", |
| 64 | + url: "https://ethereum.org", |
| 65 | + logo: { |
| 66 | + "@type": "ImageObject", |
| 67 | + url: "https://ethereum.org/assets/eth-logo.png", |
| 68 | + width: "256", |
| 69 | + height: "417", |
| 70 | + }, |
| 71 | + }, |
| 72 | + reviewedBy: { |
| 73 | + "@type": "Organization", |
| 74 | + name: "ethereum.org", |
| 75 | + url: "https://ethereum.org", |
| 76 | + logo: { |
| 77 | + "@type": "ImageObject", |
| 78 | + url: "https://ethereum.org/images/eth-home-icon.png", |
| 79 | + }, |
| 80 | + }, |
| 81 | + mainEntity: { |
| 82 | + "@type": "Event", |
| 83 | + "@id": `${url}#ethereum-10-year-anniversary`, |
| 84 | + }, |
| 85 | + } |
| 86 | + |
| 87 | + const eventJsonLd = { |
| 88 | + "@context": "https://schema.org", |
| 89 | + "@type": "Event", |
| 90 | + "@id": `${url}#ethereum-10-year-anniversary`, |
| 91 | + name: t("page-10-year-anniversary-meta-title"), |
| 92 | + description: t("page-10-year-anniversary-meta-description"), |
| 93 | + startDate: "2024-07-30", |
| 94 | + endDate: "2024-07-30", |
| 95 | + eventStatus: "https://schema.org/EventCompleted", |
| 96 | + eventAttendanceMode: "https://schema.org/OnlineEventAttendanceMode", |
| 97 | + url: url, |
| 98 | + organizer: { |
| 99 | + "@type": "Organization", |
| 100 | + name: "Ethereum Foundation", |
| 101 | + url: "https://ethereum.org", |
| 102 | + }, |
| 103 | + location: { |
| 104 | + "@type": "VirtualLocation", |
| 105 | + url: url, |
| 106 | + }, |
| 107 | + image: { |
| 108 | + "@type": "ImageObject", |
| 109 | + url: "https://ethereum.org/assets/10-years/10-years-hero.png", |
| 110 | + width: "1200", |
| 111 | + height: "630", |
| 112 | + }, |
| 113 | + } |
| 114 | + |
| 115 | + const videoJsonLd = { |
| 116 | + "@context": "https://schema.org", |
| 117 | + "@type": "VideoObject", |
| 118 | + name: "Ethereum: 10 Years Anniversary", |
| 119 | + description: t("page-10-year-anniversary-meta-description"), |
| 120 | + thumbnailUrl: "https://i.ytimg.com/vi/gjwr-7PgpTC/maxresdefault.jpg", |
| 121 | + uploadDate: "2024-07-30", |
| 122 | + duration: "PT5M30S", |
| 123 | + embedUrl: "https://www.youtube.com/embed/gjwr-7PgpTC", |
| 124 | + publisher: { |
| 125 | + "@type": "Organization", |
| 126 | + name: "Ethereum Foundation", |
| 127 | + url: "https://ethereum.org", |
| 128 | + }, |
| 129 | + reviewedBy: { |
| 130 | + "@type": "Organization", |
| 131 | + name: "ethereum.org", |
| 132 | + url: "https://ethereum.org", |
| 133 | + logo: { |
| 134 | + "@type": "ImageObject", |
| 135 | + url: "https://ethereum.org/images/eth-home-icon.png", |
| 136 | + }, |
| 137 | + }, |
| 138 | + } |
| 139 | + |
| 140 | + return ( |
| 141 | + <PageJsonLD structuredData={[webPageJsonLd, eventJsonLd, videoJsonLd]} /> |
| 142 | + ) |
| 143 | +} |
0 commit comments