diff --git a/app/[locale]/10years/page-jsonld.tsx b/app/[locale]/10years/page-jsonld.tsx index 7eac36b6c13..05cd1626f5d 100644 --- a/app/[locale]/10years/page-jsonld.tsx +++ b/app/[locale]/10years/page-jsonld.tsx @@ -4,6 +4,10 @@ import { FileContributor } from "@/lib/types" import PageJsonLD from "@/components/PageJsonLD" +import { + ethereumCommunityOrganization, + ethereumFoundationOrganization, +} from "@/lib/utils/jsonld" import { normalizeUrlForJsonLd } from "@/lib/utils/url" export default async function TenYearJsonLD({ @@ -25,89 +29,57 @@ export default async function TenYearJsonLD({ url: contributor.html_url, })) - const webPageJsonLd = { + const jsonLd = { "@context": "https://schema.org", - "@type": "WebPage", - "@id": url, - name: t("page-10-year-anniversary-meta-title"), - description: t("page-10-year-anniversary-meta-description"), - url: url, - inLanguage: locale, - author: [ + "@graph": [ { - "@type": "Organization", - name: "ethereum.org", - url: "https://ethereum.org", - }, - ], - contributor: contributorList, - breadcrumb: { - "@type": "BreadcrumbList", - itemListElement: [ - { - "@type": "ListItem", - position: 1, - name: "Home", - item: normalizeUrlForJsonLd(locale, "/"), + "@type": "WebPage", + "@id": url, + name: t("page-10-year-anniversary-meta-title"), + description: t("page-10-year-anniversary-meta-description"), + url: url, + inLanguage: locale, + author: [ethereumCommunityOrganization], + contributor: contributorList, + isPartOf: { + "@type": "WebSite", + name: "ethereum.org", + url: "https://ethereum.org", }, - { - "@type": "ListItem", - position: 2, - name: t("page-10-year-anniversary-meta-title"), - item: url, + breadcrumb: { + "@type": "BreadcrumbList", + itemListElement: [ + { + "@type": "ListItem", + position: 1, + name: "Home", + item: normalizeUrlForJsonLd(locale, "/"), + }, + { + "@type": "ListItem", + position: 2, + name: t("page-10-year-anniversary-meta-title"), + item: url, + }, + ], }, - ], - }, - publisher: { - "@type": "Organization", - name: "ethereum.org", - url: "https://ethereum.org", - logo: { - "@type": "ImageObject", - url: "https://ethereum.org/assets/eth-logo.png", - width: "256", - height: "417", + publisher: ethereumFoundationOrganization, + reviewedBy: ethereumFoundationOrganization, + mainEntity: { "@id": `${url}#video` }, }, - }, - reviewedBy: { - "@type": "Organization", - name: "ethereum.org", - url: "https://ethereum.org", - logo: { - "@type": "ImageObject", - url: "https://ethereum.org/images/eth-home-icon.png", - }, - }, - mainEntity: { - "@type": "Event", - "@id": `${url}#ethereum-10-year-anniversary`, - }, - } - - const videoJsonLd = { - "@context": "https://schema.org", - "@type": "VideoObject", - name: "Ethereum: 10 Years Anniversary", - description: t("page-10-year-anniversary-meta-description"), - thumbnailUrl: "https://i.ytimg.com/vi/gjwr-7PgpTC/maxresdefault.jpg", - uploadDate: "2024-07-30T00:00:00Z", - duration: "PT5M30S", - embedUrl: "https://www.youtube.com/embed/gjwr-7PgpTC", - publisher: { - "@type": "Organization", - name: "Ethereum Foundation", - url: "https://ethereum.org", - }, - reviewedBy: { - "@type": "Organization", - name: "ethereum.org", - url: "https://ethereum.org", - logo: { - "@type": "ImageObject", - url: "https://ethereum.org/images/eth-home-icon.png", + { + "@type": "VideoObject", + name: "Ethereum: 10 Years Anniversary", + description: t("page-10-year-anniversary-meta-description"), + thumbnailUrl: "https://i.ytimg.com/vi/gjwr-7PgpTC/maxresdefault.jpg", + uploadDate: "2024-07-30T00:00:00Z", + duration: "PT5M30S", + embedUrl: "https://www.youtube.com/embed/gjwr-7PgpTC", + publisher: ethereumFoundationOrganization, + reviewedBy: ethereumFoundationOrganization, }, - }, + ], } - return + return } diff --git a/app/[locale]/[...slug]/page-jsonld.tsx b/app/[locale]/[...slug]/page-jsonld.tsx index 64ca2bd856a..7988c0bfb7b 100644 --- a/app/[locale]/[...slug]/page-jsonld.tsx +++ b/app/[locale]/[...slug]/page-jsonld.tsx @@ -2,6 +2,10 @@ import { FileContributor, Frontmatter } from "@/lib/types" import PageJsonLD from "@/components/PageJsonLD" +import { + ethereumCommunityOrganization, + ethereumFoundationOrganization, +} from "@/lib/utils/jsonld" import { normalizeUrlForJsonLd } from "@/lib/utils/url" export default async function SlugJsonLD({ @@ -48,87 +52,54 @@ export default async function SlugJsonLD({ url: contributor.html_url, })) - // JSON-LD structured data for the slug page - const webPageJsonLd = { + const jsonLd = { "@context": "https://schema.org", - "@type": "WebPage", - "@id": url, - name: frontmatter.title, - description: frontmatter.description, - url: url, - inLanguage: locale, - author: [ + "@graph": [ { - "@type": "Organization", - name: "ethereum.org", - url: "https://ethereum.org", + "@type": "WebPage", + "@id": url, + name: frontmatter.title, + description: frontmatter.description, + url: url, + inLanguage: locale, + author: [ethereumCommunityOrganization], + contributor: contributorList, + isPartOf: { + "@type": "WebSite", + "@id": "https://ethereum.org/#website", + name: "ethereum.org", + url: "https://ethereum.org", + }, + breadcrumb: { + "@type": "BreadcrumbList", + itemListElement: breadcrumbItems, + }, + publisher: ethereumFoundationOrganization, + reviewedBy: ethereumFoundationOrganization, + mainEntity: { "@id": `${url}#article` }, }, - ], - contributor: contributorList, - isPartOf: { - "@type": "WebSite", - name: "ethereum.org", - url: "https://ethereum.org", - }, - breadcrumb: { - "@type": "BreadcrumbList", - itemListElement: breadcrumbItems, - }, - publisher: { - "@type": "Organization", - name: "ethereum.org", - url: "https://ethereum.org", - }, - reviewedBy: { - "@type": "Organization", - name: "ethereum.org", - url: "https://ethereum.org", - logo: { - "@type": "ImageObject", - url: "https://ethereum.org/images/eth-home-icon.png", - }, - }, - } - - // JSON-LD for the article content - const articleJsonLd = { - "@context": "https://schema.org", - "@type": "Article", - headline: frontmatter.title, - description: frontmatter.description, - image: frontmatter.image - ? `https://ethereum.org${frontmatter.image}` - : undefined, - author: [ { - "@type": "Organization", - name: "ethereum.org", - url: "https://ethereum.org", + "@type": "Article", + "@id": `${url}#article`, + headline: frontmatter.title, + description: frontmatter.description, + image: frontmatter.image + ? `https://ethereum.org${frontmatter.image}` + : undefined, + author: [ethereumCommunityOrganization], + contributor: contributorList, + publisher: ethereumFoundationOrganization, + reviewedBy: ethereumFoundationOrganization, + dateModified: frontmatter.published, + mainEntityOfPage: url, + about: { + "@type": "Thing", + name: frontmatter.title, + description: frontmatter.description, + }, }, ], - contributor: contributorList, - publisher: { - "@type": "Organization", - name: "ethereum.org", - url: "https://ethereum.org", - }, - reviewedBy: { - "@type": "Organization", - name: "ethereum.org", - url: "https://ethereum.org", - logo: { - "@type": "ImageObject", - url: "https://ethereum.org/images/eth-home-icon.png", - }, - }, - dateModified: frontmatter.published, - mainEntityOfPage: url, - about: { - "@type": "Thing", - name: frontmatter.title, - description: frontmatter.description, - }, } - return + return } diff --git a/app/[locale]/apps/[application]/page-jsonld.tsx b/app/[locale]/apps/[application]/page-jsonld.tsx index c34fcb207f0..11b065c8824 100644 --- a/app/[locale]/apps/[application]/page-jsonld.tsx +++ b/app/[locale]/apps/[application]/page-jsonld.tsx @@ -2,6 +2,10 @@ import { AppData, FileContributor } from "@/lib/types" import PageJsonLD from "@/components/PageJsonLD" +import { + ethereumCommunityOrganization, + ethereumFoundationOrganization, +} from "@/lib/utils/jsonld" import { normalizeUrlForJsonLd, slugify } from "@/lib/utils/url" export default async function AppsAppJsonLD({ @@ -21,90 +25,75 @@ export default async function AppsAppJsonLD({ url: contributor.html_url, })) - // JSON-LD structured data for the individual app page - const webPageJsonLd = { + const jsonLd = { "@context": "https://schema.org", - "@type": "WebPage", - "@id": url, - name: `Ethereum Apps - ${app.name}`, - description: app.description, - url: url, - inLanguage: locale, - contributor: contributorList, - author: [ + "@graph": [ { - "@type": "Organization", - name: "ethereum.org", - url: "https://ethereum.org", - }, - ], - breadcrumb: { - "@type": "BreadcrumbList", - itemListElement: [ - { - "@type": "ListItem", - position: 1, - name: "Home", - item: normalizeUrlForJsonLd(locale, "/"), + "@type": "WebPage", + "@id": url, + name: `Ethereum Apps - ${app.name}`, + description: app.description, + url: url, + inLanguage: locale, + contributor: contributorList, + author: [ethereumCommunityOrganization], + isPartOf: { + "@type": "WebSite", + "@id": "https://ethereum.org/#website", + name: "ethereum.org", + url: "https://ethereum.org", }, - { - "@type": "ListItem", - position: 2, - name: "Apps", - item: normalizeUrlForJsonLd(locale, "/apps/"), + breadcrumb: { + "@type": "BreadcrumbList", + itemListElement: [ + { + "@type": "ListItem", + position: 1, + name: "Home", + item: normalizeUrlForJsonLd(locale, "/"), + }, + { + "@type": "ListItem", + position: 2, + name: "Apps", + item: normalizeUrlForJsonLd(locale, "/apps/"), + }, + { + "@type": "ListItem", + position: 3, + name: app.name, + item: url, + }, + ], }, - { - "@type": "ListItem", - position: 3, - name: app.name, - item: url, - }, - ], - }, - publisher: { - "@type": "Organization", - name: "ethereum.org", - url: "https://ethereum.org", - logo: { - "@type": "ImageObject", - url: "https://ethereum.org/images/eth-home-icon.png", - }, - }, - reviewedBy: { - "@type": "Organization", - name: "ethereum.org", - url: "https://ethereum.org", - logo: { - "@type": "ImageObject", - url: "https://ethereum.org/images/eth-home-icon.png", + publisher: ethereumFoundationOrganization, + reviewedBy: ethereumFoundationOrganization, + mainEntity: { "@id": `${url}#applications` }, }, - }, - } - - const softwareApplicationJsonLd = { - "@context": "https://schema.org", - "@type": "SoftwareApplication", - name: app.name, - description: app.description, - url: app.url, - image: app.image, - applicationCategory: app.category, - applicationSubCategory: app.subCategory.join(", "), - operatingSystem: "Web Browser", - author: [ { - "@type": "Organization", - name: app.parentCompany, + "@type": "SoftwareApplication", + "@id": `${url}#applications`, + name: app.name, + description: app.description, + url: app.url, + image: app.image, + applicationCategory: app.category, + applicationSubCategory: app.subCategory.join(", "), + operatingSystem: "Web Browser", + author: [ + { + "@type": "Organization", + name: app.parentCompany, + }, + ], + datePublished: app.dateOfLaunch, + dateModified: app.lastUpdated, + inLanguage: app.languages, + screenshot: app.screenshots.slice(0, 5), + sameAs: [app.twitter, app.github, app.discord].filter(Boolean), }, ], - datePublished: app.dateOfLaunch, - dateModified: app.lastUpdated, - inLanguage: app.languages, - screenshot: app.screenshots.slice(0, 5), - sameAs: [app.twitter, app.github, app.discord].filter(Boolean), } - return ( - - ) + return } diff --git a/app/[locale]/apps/categories/[catetgoryName]/page-jsonld.tsx b/app/[locale]/apps/categories/[catetgoryName]/page-jsonld.tsx index 9164f052b1d..bca0929918b 100644 --- a/app/[locale]/apps/categories/[catetgoryName]/page-jsonld.tsx +++ b/app/[locale]/apps/categories/[catetgoryName]/page-jsonld.tsx @@ -4,6 +4,10 @@ import { AppCategoryData, AppData, FileContributor } from "@/lib/types" import PageJsonLD from "@/components/PageJsonLD" +import { + ethereumCommunityOrganization, + ethereumFoundationOrganization, +} from "@/lib/utils/jsonld" import { normalizeUrlForJsonLd } from "@/lib/utils/url" export default async function AppsCategoryJsonLD({ @@ -31,81 +35,68 @@ export default async function AppsCategoryJsonLD({ url: contributor.html_url, })) - // JSON-LD structured data for the apps category page - const webPageJsonLd = { + const jsonLd = { "@context": "https://schema.org", - "@type": "WebPage", - "@id": url, - name: t(category.metaTitle), - description: t(category.metaDescription), - url: url, - inLanguage: locale, - contributor: contributorList, - author: [ + "@graph": [ { - "@type": "Organization", - name: "ethereum.org", - url: "https://ethereum.org", - }, - ], - breadcrumb: { - "@type": "BreadcrumbList", - itemListElement: [ - { - "@type": "ListItem", - position: 1, - name: "Home", - item: normalizeUrlForJsonLd(locale, "/"), + "@type": "WebPage", + "@id": url, + name: t(category.metaTitle), + description: t(category.metaDescription), + url: url, + inLanguage: locale, + contributor: contributorList, + author: [ethereumCommunityOrganization], + isPartOf: { + "@type": "WebSite", + "@id": "https://ethereum.org/#website", + name: "ethereum.org", + url: "https://ethereum.org", }, - { - "@type": "ListItem", - position: 2, - name: "Apps", - item: normalizeUrlForJsonLd(locale, "/apps/"), - }, - { - "@type": "ListItem", - position: 3, - name: t(category.name), - item: url, + breadcrumb: { + "@type": "BreadcrumbList", + itemListElement: [ + { + "@type": "ListItem", + position: 1, + name: "Home", + item: normalizeUrlForJsonLd(locale, "/"), + }, + { + "@type": "ListItem", + position: 2, + name: "Apps", + item: normalizeUrlForJsonLd(locale, "/apps/"), + }, + { + "@type": "ListItem", + position: 3, + name: t(category.name), + item: url, + }, + ], }, - ], - }, - publisher: { - "@type": "Organization", - name: "ethereum.org", - url: "https://ethereum.org", - logo: { - "@type": "ImageObject", - url: "https://ethereum.org/images/eth-home-icon.png", + publisher: ethereumFoundationOrganization, + reviewedBy: ethereumFoundationOrganization, + mainEntity: { "@id": `${url}#categories` }, }, - }, - reviewedBy: { - "@type": "Organization", - name: "ethereum.org", - url: "https://ethereum.org", - logo: { - "@type": "ImageObject", - url: "https://ethereum.org/images/eth-home-icon.png", + { + "@type": "ItemList", + "@id": `${url}#categories`, + name: t(category.name), + description: t(category.description), + url: url, + numberOfItems: categoryApps.length, + itemListElement: categoryApps.slice(0, 10).map((app, index) => ({ + "@type": "ListItem", + position: index + 1, + name: app.name, + description: app.description, + url: app.url, + })), }, - }, - } - - const categoryAppsJsonLd = { - "@context": "https://schema.org", - "@type": "ItemList", - name: t(category.name), - description: t(category.description), - url: url, - numberOfItems: categoryApps.length, - itemListElement: categoryApps.slice(0, 10).map((app, index) => ({ - "@type": "ListItem", - position: index + 1, - name: app.name, - description: app.description, - url: app.url, - })), + ], } - return + return } diff --git a/app/[locale]/apps/page-jsonld.tsx b/app/[locale]/apps/page-jsonld.tsx index ad7ab9d949e..1f093efab63 100644 --- a/app/[locale]/apps/page-jsonld.tsx +++ b/app/[locale]/apps/page-jsonld.tsx @@ -4,6 +4,10 @@ import { FileContributor } from "@/lib/types" import PageJsonLD from "@/components/PageJsonLD" +import { + ethereumCommunityOrganization, + ethereumFoundationOrganization, +} from "@/lib/utils/jsonld" import { normalizeUrlForJsonLd } from "@/lib/utils/url" import { appsCategories } from "@/data/apps/categories" @@ -25,75 +29,67 @@ export default async function AppsJsonLD({ url: contributor.html_url, })) - // JSON-LD structured data for the apps page - const webPageJsonLd = { + const jsonLd = { "@context": "https://schema.org", - "@type": "WebPage", - "@id": url, - name: t("page-apps-meta-title"), - description: t("page-apps-meta-description"), - url: url, - inLanguage: locale, - contributor: contributorList, - author: [ + "@graph": [ { - "@type": "Organization", - name: "ethereum.org", - url: "https://ethereum.org", - }, - ], - breadcrumb: { - "@type": "BreadcrumbList", - itemListElement: [ - { - "@type": "ListItem", - position: 1, - name: "Home", - item: normalizeUrlForJsonLd(locale, "/"), + "@type": "WebPage", + "@id": url, + name: t("page-apps-meta-title"), + description: t("page-apps-meta-description"), + url: url, + inLanguage: locale, + contributor: contributorList, + author: [ethereumCommunityOrganization], + isPartOf: { + "@type": "WebSite", + "@id": "https://ethereum.org/#website", + name: "ethereum.org", + url: "https://ethereum.org", }, - { - "@type": "ListItem", - position: 2, - name: t("page-apps-meta-title"), - item: url, + breadcrumb: { + "@type": "BreadcrumbList", + itemListElement: [ + { + "@type": "ListItem", + position: 1, + name: "Home", + item: normalizeUrlForJsonLd(locale, "/"), + }, + { + "@type": "ListItem", + position: 2, + name: t("page-apps-meta-title"), + item: url, + }, + ], }, - ], - }, - publisher: { - "@type": "Organization", - name: "ethereum.org", - url: "https://ethereum.org", - logo: { - "@type": "ImageObject", - url: "https://ethereum.org/images/eth-home-icon.png", + publisher: ethereumFoundationOrganization, + reviewedBy: ethereumFoundationOrganization, + mainEntity: { "@id": `${url}#apps` }, }, - }, - reviewedBy: { - "@type": "Organization", - name: "ethereum.org", - url: "https://ethereum.org", - logo: { - "@type": "ImageObject", - url: "https://ethereum.org/images/eth-home-icon.png", + { + "@type": "ItemList", + "@id": `${url}#apps`, + name: t("page-apps-categories-title"), + description: t("page-apps-meta-description"), + url: url, + numberOfItems: Object.keys(appsCategories).length, + itemListElement: Object.values(appsCategories).map( + (category, index) => ({ + "@type": "ListItem", + position: index + 1, + name: t(category.name), + description: t(category.description), + url: normalizeUrlForJsonLd( + locale, + `/apps/categories/${category.slug}` + ), + }) + ), }, - }, - } - - const appCategoriesJsonLd = { - "@context": "https://schema.org", - "@type": "ItemList", - name: t("page-apps-categories-title"), - description: t("page-apps-meta-description"), - url: url, - numberOfItems: Object.keys(appsCategories).length, - itemListElement: Object.values(appsCategories).map((category, index) => ({ - "@type": "ListItem", - position: index + 1, - name: t(category.name), - description: t(category.description), - url: normalizeUrlForJsonLd(locale, `/apps/categories/${category.slug}`), - })), + ], } - return + return } diff --git a/app/[locale]/assets/page-jsonld.tsx b/app/[locale]/assets/page-jsonld.tsx index ef376770bb3..228af391037 100644 --- a/app/[locale]/assets/page-jsonld.tsx +++ b/app/[locale]/assets/page-jsonld.tsx @@ -4,6 +4,10 @@ import { FileContributor } from "@/lib/types" import PageJsonLD from "@/components/PageJsonLD" +import { + ethereumCommunityOrganization, + ethereumFoundationOrganization, +} from "@/lib/utils/jsonld" import { normalizeUrlForJsonLd } from "@/lib/utils/url" export default async function AssetsJsonLD({ @@ -23,106 +27,81 @@ export default async function AssetsJsonLD({ url: contributor.html_url, })) - // JSON-LD structured data for the assets page - const webPageJsonLd = { + const jsonLd = { "@context": "https://schema.org", - "@type": "WebPage", - "@id": url, - name: t("page-assets-meta-title"), - description: t("page-assets-meta-desc"), - url: url, - inLanguage: locale, - contributor: contributorList, - author: [ + "@graph": [ { - "@type": "Organization", - name: "ethereum.org", - url: "https://ethereum.org", - }, - ], - breadcrumb: { - "@type": "BreadcrumbList", - itemListElement: [ - { - "@type": "ListItem", - position: 1, - name: "Home", - item: normalizeUrlForJsonLd(locale, "/"), + "@type": "WebPage", + "@id": url, + name: t("page-assets-meta-title"), + description: t("page-assets-meta-desc"), + url: url, + inLanguage: locale, + contributor: contributorList, + author: [ethereumCommunityOrganization], + isPartOf: { + "@type": "WebSite", + "@id": "https://ethereum.org/#website", + name: "ethereum.org", + url: "https://ethereum.org", }, - { - "@type": "ListItem", - position: 2, - name: t("page-assets-meta-title"), - item: normalizeUrlForJsonLd(locale, "/assets/"), + breadcrumb: { + "@type": "BreadcrumbList", + itemListElement: [ + { + "@type": "ListItem", + position: 1, + name: "Home", + item: normalizeUrlForJsonLd(locale, "/"), + }, + { + "@type": "ListItem", + position: 2, + name: t("page-assets-meta-title"), + item: normalizeUrlForJsonLd(locale, "/assets/"), + }, + ], }, - ], - }, - publisher: { - "@type": "Organization", - name: "ethereum.org", - url: "https://ethereum.org", - logo: { - "@type": "ImageObject", - url: "https://ethereum.org/images/eth-home-icon.png", - }, - }, - reviewedBy: { - "@type": "Organization", - name: "ethereum.org", - url: "https://ethereum.org", - logo: { - "@type": "ImageObject", - url: "https://ethereum.org/images/eth-home-icon.png", + publisher: ethereumFoundationOrganization, + reviewedBy: ethereumFoundationOrganization, + mainEntity: { "@id": `${url}#assets` }, }, - }, - } - - const creativeWorkJsonLd = { - "@context": "https://schema.org", - "@type": "ItemList", - name: t("page-assets-h1"), - description: t("page-assets-meta-desc"), - url: url, - numberOfItems: 3, - itemListElement: [ { - "@type": "ListItem", - position: 1, - name: t("page-assets-illustrations"), - description: - "Artistic works by Liam Cobb, Viktor Hachmang, Patrick Atkins, and others", - url: normalizeUrlForJsonLd(locale, "/assets/#illustrations"), - }, - { - "@type": "ListItem", - position: 2, - name: t("page-assets-historical-artwork"), - description: "Historical Ethereum artwork and graphics", - url: normalizeUrlForJsonLd(locale, "/assets/#historical"), - }, - { - "@type": "ListItem", - position: 3, - name: t("page-assets-ethereum-brand-assets"), - description: "Official Ethereum brand assets, logos, and graphics", - url: normalizeUrlForJsonLd(locale, "/assets/#brand"), + "@type": "ItemList", + "@id": `${url}#assets`, + name: t("page-assets-h1"), + description: t("page-assets-meta-desc"), + url: url, + numberOfItems: 3, + itemListElement: [ + { + "@type": "ListItem", + position: 1, + name: t("page-assets-illustrations"), + description: + "Artistic works by Liam Cobb, Viktor Hachmang, Patrick Atkins, and others", + url: normalizeUrlForJsonLd(locale, "/assets/#illustrations"), + }, + { + "@type": "ListItem", + position: 2, + name: t("page-assets-historical-artwork"), + description: "Historical Ethereum artwork and graphics", + url: normalizeUrlForJsonLd(locale, "/assets/#historical"), + }, + { + "@type": "ListItem", + position: 3, + name: t("page-assets-ethereum-brand-assets"), + description: "Official Ethereum brand assets, logos, and graphics", + url: normalizeUrlForJsonLd(locale, "/assets/#brand"), + }, + ], + publisher: ethereumFoundationOrganization, + reviewedBy: ethereumFoundationOrganization, }, ], - publisher: { - "@type": "Organization", - name: "ethereum.org", - url: "https://ethereum.org", - }, - reviewedBy: { - "@type": "Organization", - name: "ethereum.org", - url: "https://ethereum.org", - logo: { - "@type": "ImageObject", - url: "https://ethereum.org/images/eth-home-icon.png", - }, - }, } - return + return } diff --git a/app/[locale]/bug-bounty/page-jsonld.tsx b/app/[locale]/bug-bounty/page-jsonld.tsx index 74c597e4b77..292a7a3fbe8 100644 --- a/app/[locale]/bug-bounty/page-jsonld.tsx +++ b/app/[locale]/bug-bounty/page-jsonld.tsx @@ -4,6 +4,10 @@ import { FileContributor } from "@/lib/types" import PageJsonLD from "@/components/PageJsonLD" +import { + ethereumCommunityOrganization, + ethereumFoundationOrganization, +} from "@/lib/utils/jsonld" import { normalizeUrlForJsonLd } from "@/lib/utils/url" export default async function BugBountyJsonLD({ @@ -23,59 +27,46 @@ export default async function BugBountyJsonLD({ url: contributor.html_url, })) - // JSON-LD structured data for the bug bounty page - const webPageJsonLd = { + const jsonLd = { "@context": "https://schema.org", - "@type": "WebPage", - "@id": url, - name: t("page-upgrades-bug-bounty-meta-title"), - description: t("page-upgrades-bug-bounty-meta-description"), - url: url, - inLanguage: locale, - contributor: contributorList, - author: [ + "@graph": [ { - "@type": "Organization", - name: "ethereum.org", - url: "https://ethereum.org", - }, - ], - breadcrumb: { - "@type": "BreadcrumbList", - itemListElement: [ - { - "@type": "ListItem", - position: 1, - name: "Home", - item: normalizeUrlForJsonLd(locale, "/"), + "@type": "WebPage", + "@id": url, + name: t("page-upgrades-bug-bounty-meta-title"), + description: t("page-upgrades-bug-bounty-meta-description"), + url: url, + inLanguage: locale, + contributor: contributorList, + author: [ethereumCommunityOrganization], + isPartOf: { + "@type": "WebSite", + "@id": "https://ethereum.org/#website", + name: "ethereum.org", + url: "https://ethereum.org", }, - { - "@type": "ListItem", - position: 2, - name: t("page-upgrades-bug-bounty-meta-title"), - item: normalizeUrlForJsonLd(locale, "/bug-bounty/"), + breadcrumb: { + "@type": "BreadcrumbList", + itemListElement: [ + { + "@type": "ListItem", + position: 1, + name: "Home", + item: normalizeUrlForJsonLd(locale, "/"), + }, + { + "@type": "ListItem", + position: 2, + name: t("page-upgrades-bug-bounty-meta-title"), + item: normalizeUrlForJsonLd(locale, "/bug-bounty/"), + }, + ], }, - ], - }, - publisher: { - "@type": "Organization", - name: "ethereum.org", - url: "https://ethereum.org", - logo: { - "@type": "ImageObject", - url: "https://ethereum.org/images/eth-home-icon.png", + publisher: ethereumFoundationOrganization, + reviewedBy: ethereumFoundationOrganization, }, - }, - reviewedBy: { - "@type": "Organization", - name: "ethereum.org", - url: "https://ethereum.org", - logo: { - "@type": "ImageObject", - url: "https://ethereum.org/images/eth-home-icon.png", - }, - }, + ], } - return + return } diff --git a/app/[locale]/collectibles/page-jsonld.tsx b/app/[locale]/collectibles/page-jsonld.tsx index 30231bb5b09..3e06c6662d5 100644 --- a/app/[locale]/collectibles/page-jsonld.tsx +++ b/app/[locale]/collectibles/page-jsonld.tsx @@ -4,6 +4,10 @@ import { FileContributor } from "@/lib/types" import PageJsonLD from "@/components/PageJsonLD" +import { + ethereumCommunityOrganization, + ethereumFoundationOrganization, +} from "@/lib/utils/jsonld" import { normalizeUrlForJsonLd } from "@/lib/utils/url" import { COLLECTIBLES_BASE_URL } from "./constants" @@ -30,111 +34,82 @@ export default async function CollectiblesJsonLD({ url: contributor.html_url, })) - // JSON-LD structured data for the collectibles page - const webPageJsonLd = { + const jsonLd = { "@context": "https://schema.org", - "@type": "WebPage", - "@id": url, - name: t("page-collectibles-hero-header"), - description: t("page-collectibles-hero-description"), - url: url, - inLanguage: locale, - contributor: contributorList, - author: [ + "@graph": [ { - "@type": "Organization", - name: "ethereum.org", - url: "https://ethereum.org", - }, - ], - breadcrumb: { - "@type": "BreadcrumbList", - itemListElement: [ - { - "@type": "ListItem", - position: 1, - name: "Home", - item: normalizeUrlForJsonLd(locale, "/"), + "@type": "WebPage", + "@id": url, + name: t("page-collectibles-hero-header"), + description: t("page-collectibles-hero-description"), + url: url, + inLanguage: locale, + contributor: contributorList, + author: [ethereumCommunityOrganization], + isPartOf: { + "@type": "WebSite", + "@id": "https://ethereum.org/#website", + name: "ethereum.org", + url: "https://ethereum.org", }, - { - "@type": "ListItem", - position: 2, - name: t("page-collectibles-hero-header"), - item: url, + breadcrumb: { + "@type": "BreadcrumbList", + itemListElement: [ + { + "@type": "ListItem", + position: 1, + name: "Home", + item: normalizeUrlForJsonLd(locale, "/"), + }, + { + "@type": "ListItem", + position: 2, + name: t("page-collectibles-hero-header"), + item: url, + }, + ], }, - ], - }, - publisher: { - "@type": "Organization", - name: "ethereum.org", - url: "https://ethereum.org", - logo: { - "@type": "ImageObject", - url: "https://ethereum.org/images/eth-home-icon.png", - }, - }, - reviewedBy: { - "@type": "Organization", - name: "ethereum.org", - url: "https://ethereum.org", - logo: { - "@type": "ImageObject", - url: "https://ethereum.org/images/eth-home-icon.png", - }, - }, - } - - const collectiblesCollectionJsonLd = { - "@context": "https://schema.org", - "@type": "ItemList", - name: t("page-collectibles-hero-header"), - description: t("page-collectibles-hero-description"), - url: url, - numberOfItems: stats.collectiblesCount || badges.length, - itemListElement: badges.slice(0, 10).map((badge, index) => ({ - "@type": "ListItem", - position: index + 1, - name: badge.name || `Badge ${index + 1}`, - description: badge.description || "Ethereum community badge", - url: badge.link || `${COLLECTIBLES_BASE_URL}/badge/${badge.id}`, - image: badge.image, - })), - publisher: { - "@type": "Organization", - name: "ethereum.org", - url: "https://ethereum.org", - }, - reviewedBy: { - "@type": "Organization", - name: "ethereum.org", - url: "https://ethereum.org", - logo: { - "@type": "ImageObject", - url: "https://ethereum.org/images/eth-home-icon.png", - }, - }, - additionalProperty: [ - { - "@type": "PropertyValue", - name: "Total Collectors", - value: stats.uniqueAddressesCount || 0, + publisher: ethereumFoundationOrganization, + reviewedBy: ethereumFoundationOrganization, + mainEntity: { "@id": `${url}#collectibles` }, }, { - "@type": "PropertyValue", - name: "Total Minted", - value: stats.collectorsCount || 0, - }, - { - "@type": "PropertyValue", - name: "Unique Badges", - value: stats.collectiblesCount || badges.length, + "@type": "ItemList", + "@id": `${url}#collectibles`, + name: t("page-collectibles-hero-header"), + description: t("page-collectibles-hero-description"), + url: url, + numberOfItems: stats.collectiblesCount || badges.length, + itemListElement: badges.slice(0, 10).map((badge, index) => ({ + "@type": "ListItem", + position: index + 1, + name: badge.name || `Badge ${index + 1}`, + description: badge.description || "Ethereum community badge", + url: badge.link || `${COLLECTIBLES_BASE_URL}/badge/${badge.id}`, + image: badge.image, + })), + publisher: ethereumFoundationOrganization, + reviewedBy: ethereumFoundationOrganization, + additionalProperty: [ + { + "@type": "PropertyValue", + name: "Total Collectors", + value: stats.uniqueAddressesCount || 0, + }, + { + "@type": "PropertyValue", + name: "Total Minted", + value: stats.collectorsCount || 0, + }, + { + "@type": "PropertyValue", + name: "Unique Badges", + value: stats.collectiblesCount || badges.length, + }, + ], }, ], } - return ( - - ) + return } diff --git a/app/[locale]/community/page-jsonld.tsx b/app/[locale]/community/page-jsonld.tsx index ce14986275f..87bb4aa98d8 100644 --- a/app/[locale]/community/page-jsonld.tsx +++ b/app/[locale]/community/page-jsonld.tsx @@ -4,6 +4,10 @@ import { FileContributor } from "@/lib/types" import PageJsonLD from "@/components/PageJsonLD" +import { + ethereumCommunityOrganization, + ethereumFoundationOrganization, +} from "@/lib/utils/jsonld" import { normalizeUrlForJsonLd } from "@/lib/utils/url" export default async function CommunityJsonLD({ @@ -23,114 +27,87 @@ export default async function CommunityJsonLD({ url: contributor.html_url, })) - // JSON-LD structured data for the community page - const webPageJsonLd = { + const jsonLd = { "@context": "https://schema.org", - "@type": "WebPage", - "@id": url, - name: t("page-community-meta-title"), - description: t("page-community-meta-description"), - url: url, - inLanguage: locale, - contributor: contributorList, - author: [ + "@graph": [ { - "@type": "Organization", - name: "ethereum.org", - url: "https://ethereum.org", - }, - ], - breadcrumb: { - "@type": "BreadcrumbList", - itemListElement: [ - { - "@type": "ListItem", - position: 1, - name: "Home", - item: normalizeUrlForJsonLd(locale, "/"), + "@type": "WebPage", + "@id": url, + name: t("page-community-meta-title"), + description: t("page-community-meta-description"), + url: url, + inLanguage: locale, + contributor: contributorList, + author: [ethereumCommunityOrganization], + isPartOf: { + "@type": "WebSite", + "@id": "https://ethereum.org/#website", + name: "ethereum.org", + url: "https://ethereum.org", }, - { - "@type": "ListItem", - position: 2, - name: t("page-community-meta-title"), - item: url, + breadcrumb: { + "@type": "BreadcrumbList", + itemListElement: [ + { + "@type": "ListItem", + position: 1, + name: "Home", + item: normalizeUrlForJsonLd(locale, "/"), + }, + { + "@type": "ListItem", + position: 2, + name: t("page-community-meta-title"), + item: url, + }, + ], }, - ], - }, - publisher: { - "@type": "Organization", - name: "ethereum.org", - url: "https://ethereum.org", - logo: { - "@type": "ImageObject", - url: "https://ethereum.org/images/eth-home-icon.png", + publisher: ethereumFoundationOrganization, + reviewedBy: ethereumFoundationOrganization, + mainEntity: { "@id": `${url}#resources` }, }, - }, - reviewedBy: { - "@type": "Organization", - name: "ethereum.org", - url: "https://ethereum.org", - logo: { - "@type": "ImageObject", - url: "https://ethereum.org/images/eth-home-icon.png", - }, - }, - } - - const communityResourcesJsonLd = { - "@context": "https://schema.org", - "@type": "ItemList", - name: t("page-community-meta-title"), - description: t("page-community-meta-description"), - url: url, - numberOfItems: 4, - itemListElement: [ { - "@type": "ListItem", - position: 1, - name: t("page-community-card-1-title"), - description: t("page-community-card-1-description"), - url: normalizeUrlForJsonLd(locale, "/community/online/"), - }, - { - "@type": "ListItem", - position: 2, - name: t("page-community-card-2-title"), - description: t("page-community-card-2-description"), - url: normalizeUrlForJsonLd(locale, "/community/events/"), - }, - { - "@type": "ListItem", - position: 3, - name: t("page-community-card-3-title"), - description: t("page-community-card-3-description"), - url: normalizeUrlForJsonLd(locale, "/community/get-involved/"), - }, - { - "@type": "ListItem", - position: 4, - name: t("page-community-card-4-title"), - description: t("page-community-card-4-description"), - url: normalizeUrlForJsonLd(locale, "/community/grants/"), + "@type": "ItemList", + "@id": `${url}#resources`, + name: t("page-community-meta-title"), + description: t("page-community-meta-description"), + url: url, + numberOfItems: 4, + itemListElement: [ + { + "@type": "ListItem", + position: 1, + name: t("page-community-card-1-title"), + description: t("page-community-card-1-description"), + url: normalizeUrlForJsonLd(locale, "/community/online/"), + }, + { + "@type": "ListItem", + position: 2, + name: t("page-community-card-2-title"), + description: t("page-community-card-2-description"), + url: normalizeUrlForJsonLd(locale, "/community/events/"), + }, + { + "@type": "ListItem", + position: 3, + name: t("page-community-card-3-title"), + description: t("page-community-card-3-description"), + url: normalizeUrlForJsonLd(locale, "/community/get-involved/"), + }, + { + "@type": "ListItem", + position: 4, + name: t("page-community-card-4-title"), + description: t("page-community-card-4-description"), + url: normalizeUrlForJsonLd(locale, "/community/grants/"), + }, + ], + publisher: ethereumFoundationOrganization, + reviewedBy: ethereumFoundationOrganization, }, ], - publisher: { - "@type": "Organization", - name: "ethereum.org", - url: "https://ethereum.org", - }, - reviewedBy: { - "@type": "Organization", - name: "ethereum.org", - url: "https://ethereum.org", - logo: { - "@type": "ImageObject", - url: "https://ethereum.org/images/eth-home-icon.png", - }, - }, } - return ( - - ) + return } diff --git a/app/[locale]/contributing/translation-program/acknowledgements/page-jsonld.tsx b/app/[locale]/contributing/translation-program/acknowledgements/page-jsonld.tsx index 55b9cb048b4..927d8272a6f 100644 --- a/app/[locale]/contributing/translation-program/acknowledgements/page-jsonld.tsx +++ b/app/[locale]/contributing/translation-program/acknowledgements/page-jsonld.tsx @@ -4,6 +4,10 @@ import { FileContributor } from "@/lib/types" import PageJsonLD from "@/components/PageJsonLD" +import { + ethereumCommunityOrganization, + ethereumFoundationOrganization, +} from "@/lib/utils/jsonld" import { normalizeUrlForJsonLd } from "@/lib/utils/url" export default async function AcknowledgementsJsonLD({ @@ -28,80 +32,67 @@ export default async function AcknowledgementsJsonLD({ url: contributor.html_url, })) - // JSON-LD structured data for the translation acknowledgements page - const webPageJsonLd = { + const jsonLd = { "@context": "https://schema.org", - "@type": "WebPage", - "@id": url, - name: t( - "page-contributing-translation-program-acknowledgements-meta-title" - ), - description: t( - "page-contributing-translation-program-acknowledgements-meta-description" - ), - url: url, - inLanguage: locale, - contributor: contributorList, - author: [ + "@graph": [ { - "@type": "Organization", - name: "ethereum.org", - url: "https://ethereum.org", - }, - ], - breadcrumb: { - "@type": "BreadcrumbList", - itemListElement: [ - { - "@type": "ListItem", - position: 1, - name: "Home", - item: normalizeUrlForJsonLd(locale, "/"), - }, - { - "@type": "ListItem", - position: 2, - name: "Contributing", - item: normalizeUrlForJsonLd(locale, "/contributing/"), + "@type": "WebPage", + "@id": url, + name: t( + "page-contributing-translation-program-acknowledgements-meta-title" + ), + description: t( + "page-contributing-translation-program-acknowledgements-meta-description" + ), + url: url, + inLanguage: locale, + contributor: contributorList, + author: [ethereumCommunityOrganization], + isPartOf: { + "@type": "WebSite", + "@id": "https://ethereum.org/#website", + name: "ethereum.org", + url: "https://ethereum.org", }, - { - "@type": "ListItem", - position: 3, - name: "Translation Program", - item: normalizeUrlForJsonLd( - locale, - "/contributing/translation-program/" - ), + breadcrumb: { + "@type": "BreadcrumbList", + itemListElement: [ + { + "@type": "ListItem", + position: 1, + name: "Home", + item: normalizeUrlForJsonLd(locale, "/"), + }, + { + "@type": "ListItem", + position: 2, + name: "Contributing", + item: normalizeUrlForJsonLd(locale, "/contributing/"), + }, + { + "@type": "ListItem", + position: 3, + name: "Translation Program", + item: normalizeUrlForJsonLd( + locale, + "/contributing/translation-program/" + ), + }, + { + "@type": "ListItem", + position: 4, + name: t( + "page-contributing-translation-program-acknowledgements-meta-title" + ), + item: url, + }, + ], }, - { - "@type": "ListItem", - position: 4, - name: t( - "page-contributing-translation-program-acknowledgements-meta-title" - ), - item: url, - }, - ], - }, - publisher: { - "@type": "Organization", - name: "ethereum.org", - url: "https://ethereum.org", - logo: { - "@type": "ImageObject", - url: "https://ethereum.org/images/eth-home-icon.png", - }, - }, - reviewedBy: { - "@type": "Organization", - name: "ethereum.org", - url: "https://ethereum.org", - logo: { - "@type": "ImageObject", - url: "https://ethereum.org/images/eth-home-icon.png", + publisher: ethereumFoundationOrganization, + reviewedBy: ethereumFoundationOrganization, }, - }, + ], } - return + return } diff --git a/app/[locale]/contributing/translation-program/contributors/page-jsonld.tsx b/app/[locale]/contributing/translation-program/contributors/page-jsonld.tsx index f6567850a42..ea2726760af 100644 --- a/app/[locale]/contributing/translation-program/contributors/page-jsonld.tsx +++ b/app/[locale]/contributing/translation-program/contributors/page-jsonld.tsx @@ -4,6 +4,10 @@ import { FileContributor } from "@/lib/types" import PageJsonLD from "@/components/PageJsonLD" +import { + ethereumCommunityOrganization, + ethereumFoundationOrganization, +} from "@/lib/utils/jsonld" import { normalizeUrlForJsonLd } from "@/lib/utils/url" export default async function ContributorsJsonLD({ @@ -28,78 +32,67 @@ export default async function ContributorsJsonLD({ `/contributing/translation-program/contributors/` ) - // JSON-LD structured data for the translation contributors page - const webPageJsonLd = { + const jsonLd = { "@context": "https://schema.org", - "@type": "WebPage", - "@id": url, - name: t("page-contributing-translation-program-contributors-meta-title"), - description: t( - "page-contributing-translation-program-contributors-meta-description" - ), - url: url, - inLanguage: locale, - contributor: contributorList, - author: [ + "@graph": [ { - "@type": "Organization", - name: "ethereum.org", - url: "https://ethereum.org", - }, - ], - breadcrumb: { - "@type": "BreadcrumbList", - itemListElement: [ - { - "@type": "ListItem", - position: 1, - name: "Home", - item: normalizeUrlForJsonLd(locale, "/"), - }, - { - "@type": "ListItem", - position: 2, - name: "Contributing", - item: normalizeUrlForJsonLd(locale, "/contributing/"), + "@type": "WebPage", + "@id": url, + name: t( + "page-contributing-translation-program-contributors-meta-title" + ), + description: t( + "page-contributing-translation-program-contributors-meta-description" + ), + url: url, + inLanguage: locale, + contributor: contributorList, + author: [ethereumCommunityOrganization], + isPartOf: { + "@type": "WebSite", + "@id": "https://ethereum.org/#website", + name: "ethereum.org", + url: "https://ethereum.org", }, - { - "@type": "ListItem", - position: 3, - name: "Translation Program", - item: normalizeUrlForJsonLd( - locale, - "/contributing/translation-program/" - ), + breadcrumb: { + "@type": "BreadcrumbList", + itemListElement: [ + { + "@type": "ListItem", + position: 1, + name: "Home", + item: normalizeUrlForJsonLd(locale, "/"), + }, + { + "@type": "ListItem", + position: 2, + name: "Contributing", + item: normalizeUrlForJsonLd(locale, "/contributing/"), + }, + { + "@type": "ListItem", + position: 3, + name: "Translation Program", + item: normalizeUrlForJsonLd( + locale, + "/contributing/translation-program/" + ), + }, + { + "@type": "ListItem", + position: 4, + name: t( + "page-contributing-translation-program-contributors-meta-title" + ), + item: url, + }, + ], }, - { - "@type": "ListItem", - position: 4, - name: t( - "page-contributing-translation-program-contributors-meta-title" - ), - item: url, - }, - ], - }, - publisher: { - "@type": "Organization", - name: "ethereum.org", - url: "https://ethereum.org", - logo: { - "@type": "ImageObject", - url: "https://ethereum.org/images/eth-home-icon.png", - }, - }, - reviewedBy: { - "@type": "Organization", - name: "ethereum.org", - url: "https://ethereum.org", - logo: { - "@type": "ImageObject", - url: "https://ethereum.org/images/eth-home-icon.png", + publisher: ethereumFoundationOrganization, + reviewedBy: ethereumFoundationOrganization, }, - }, + ], } - return + return } diff --git a/app/[locale]/contributing/translation-program/translatathon/leaderboard/page-jsonld.tsx b/app/[locale]/contributing/translation-program/translatathon/leaderboard/page-jsonld.tsx index e3a9eb26d44..bfda73495aa 100644 --- a/app/[locale]/contributing/translation-program/translatathon/leaderboard/page-jsonld.tsx +++ b/app/[locale]/contributing/translation-program/translatathon/leaderboard/page-jsonld.tsx @@ -2,6 +2,10 @@ import { FileContributor } from "@/lib/types" import PageJsonLD from "@/components/PageJsonLD" +import { + ethereumCommunityOrganization, + ethereumFoundationOrganization, +} from "@/lib/utils/jsonld" import { normalizeUrlForJsonLd } from "@/lib/utils/url" export default async function TranslatathonLeaderboardJsonLD({ @@ -22,84 +26,71 @@ export default async function TranslatathonLeaderboardJsonLD({ url: contributor.html_url, })) - // JSON-LD structured data for the translatathon leaderboard page - const webPageJsonLd = { + const jsonLd = { "@context": "https://schema.org", - "@type": "WebPage", - "@id": url, - name: "2025 Ethereum.org Translatathon Leaderboard", - description: - "Leaderboard for the 2025 Ethereum.org Translatathon showing translation progress and participant rankings", - url: url, - inLanguage: locale, - contributor: contributorList, - author: [ + "@graph": [ { - "@type": "Organization", - name: "ethereum.org", - url: "https://ethereum.org", - }, - ], - breadcrumb: { - "@type": "BreadcrumbList", - itemListElement: [ - { - "@type": "ListItem", - position: 1, - name: "Home", - item: normalizeUrlForJsonLd(locale, "/"), - }, - { - "@type": "ListItem", - position: 2, - name: "Contributing", - item: normalizeUrlForJsonLd(locale, "/contributing/"), - }, - { - "@type": "ListItem", - position: 3, - name: "Translation Program", - item: normalizeUrlForJsonLd( - locale, - "/contributing/translation-program/" - ), + "@type": "WebPage", + "@id": url, + name: "2025 Ethereum.org Translatathon Leaderboard", + description: + "Leaderboard for the 2025 Ethereum.org Translatathon showing translation progress and participant rankings", + url: url, + inLanguage: locale, + contributor: contributorList, + author: [ethereumCommunityOrganization], + isPartOf: { + "@type": "WebSite", + "@id": "https://ethereum.org/#website", + name: "ethereum.org", + url: "https://ethereum.org", }, - { - "@type": "ListItem", - position: 4, - name: "Translatathon", - item: normalizeUrlForJsonLd( - locale, - "/contributing/translation-program/translatathon/" - ), + breadcrumb: { + "@type": "BreadcrumbList", + itemListElement: [ + { + "@type": "ListItem", + position: 1, + name: "Home", + item: normalizeUrlForJsonLd(locale, "/"), + }, + { + "@type": "ListItem", + position: 2, + name: "Contributing", + item: normalizeUrlForJsonLd(locale, "/contributing/"), + }, + { + "@type": "ListItem", + position: 3, + name: "Translation Program", + item: normalizeUrlForJsonLd( + locale, + "/contributing/translation-program/" + ), + }, + { + "@type": "ListItem", + position: 4, + name: "Translatathon", + item: normalizeUrlForJsonLd( + locale, + "/contributing/translation-program/translatathon/" + ), + }, + { + "@type": "ListItem", + position: 5, + name: "Leaderboard", + item: url, + }, + ], }, - { - "@type": "ListItem", - position: 5, - name: "Leaderboard", - item: url, - }, - ], - }, - publisher: { - "@type": "Organization", - name: "ethereum.org", - url: "https://ethereum.org", - logo: { - "@type": "ImageObject", - url: "https://ethereum.org/images/eth-home-icon.png", - }, - }, - reviewedBy: { - "@type": "Organization", - name: "ethereum.org", - url: "https://ethereum.org", - logo: { - "@type": "ImageObject", - url: "https://ethereum.org/images/eth-home-icon.png", + publisher: ethereumFoundationOrganization, + reviewedBy: ethereumFoundationOrganization, }, - }, + ], } - return + return } diff --git a/app/[locale]/developers/learning-tools/page-jsonld.tsx b/app/[locale]/developers/learning-tools/page-jsonld.tsx index 41a72fa6e1c..2a345f62c05 100644 --- a/app/[locale]/developers/learning-tools/page-jsonld.tsx +++ b/app/[locale]/developers/learning-tools/page-jsonld.tsx @@ -4,6 +4,10 @@ import { FileContributor } from "@/lib/types" import PageJsonLD from "@/components/PageJsonLD" +import { + ethereumCommunityOrganization, + ethereumFoundationOrganization, +} from "@/lib/utils/jsonld" import { normalizeUrlForJsonLd } from "@/lib/utils/url" export default async function LearningToolsJsonLD({ @@ -25,65 +29,52 @@ export default async function LearningToolsJsonLD({ url: contributor.html_url, })) - // JSON-LD structured data for the developers learning tools page - const webPageJsonLd = { + const jsonLd = { "@context": "https://schema.org", - "@type": "WebPage", - "@id": url, - name: t("page-learning-tools-meta-title"), - description: t("page-learning-tools-meta-desc"), - url: url, - inLanguage: locale, - contributor: contributorList, - author: [ + "@graph": [ { - "@type": "Organization", - name: "ethereum.org", - url: "https://ethereum.org", - }, - ], - breadcrumb: { - "@type": "BreadcrumbList", - itemListElement: [ - { - "@type": "ListItem", - position: 1, - name: "Home", - item: normalizeUrlForJsonLd(locale, "/"), - }, - { - "@type": "ListItem", - position: 2, - name: "Developers", - item: normalizeUrlForJsonLd(locale, "/developers/"), + "@type": "WebPage", + "@id": url, + name: t("page-learning-tools-meta-title"), + description: t("page-learning-tools-meta-desc"), + url: url, + inLanguage: locale, + contributor: contributorList, + author: [ethereumCommunityOrganization], + isPartOf: { + "@type": "WebSite", + "@id": "https://ethereum.org/#website", + name: "ethereum.org", + url: "https://ethereum.org", }, - { - "@type": "ListItem", - position: 3, - name: t("page-learning-tools-meta-title"), - item: url, + breadcrumb: { + "@type": "BreadcrumbList", + itemListElement: [ + { + "@type": "ListItem", + position: 1, + name: "Home", + item: normalizeUrlForJsonLd(locale, "/"), + }, + { + "@type": "ListItem", + position: 2, + name: "Developers", + item: normalizeUrlForJsonLd(locale, "/developers/"), + }, + { + "@type": "ListItem", + position: 3, + name: t("page-learning-tools-meta-title"), + item: url, + }, + ], }, - ], - }, - publisher: { - "@type": "Organization", - name: "ethereum.org", - url: "https://ethereum.org", - logo: { - "@type": "ImageObject", - url: "https://ethereum.org/images/eth-home-icon.png", + publisher: ethereumFoundationOrganization, + reviewedBy: ethereumFoundationOrganization, }, - }, - reviewedBy: { - "@type": "Organization", - name: "ethereum.org", - url: "https://ethereum.org", - logo: { - "@type": "ImageObject", - url: "https://ethereum.org/images/eth-home-icon.png", - }, - }, + ], } - return + return } diff --git a/app/[locale]/developers/local-environment/page-jsonld.tsx b/app/[locale]/developers/local-environment/page-jsonld.tsx index b540579a324..3728c0a78d7 100644 --- a/app/[locale]/developers/local-environment/page-jsonld.tsx +++ b/app/[locale]/developers/local-environment/page-jsonld.tsx @@ -5,6 +5,10 @@ import { Framework } from "@/lib/interfaces" import PageJsonLD from "@/components/PageJsonLD" +import { + ethereumCommunityOrganization, + ethereumFoundationOrganization, +} from "@/lib/utils/jsonld" import { normalizeUrlForJsonLd } from "@/lib/utils/url" export default async function LocalEnvironmentJsonLD({ @@ -28,108 +32,81 @@ export default async function LocalEnvironmentJsonLD({ url: contributor.html_url, })) - // JSON-LD structured data for the developers local environment page - const webPageJsonLd = { + const jsonLd = { "@context": "https://schema.org", - "@type": "WebPage", - "@id": url, - name: t("page-local-environment-setup-meta-title"), - description: t("page-local-environment-setup-meta-desc"), - url: url, - inLanguage: locale, - contributor: contributorList, - author: [ + "@graph": [ { - "@type": "Organization", - name: "ethereum.org", - url: "https://ethereum.org", - }, - ], - breadcrumb: { - "@type": "BreadcrumbList", - itemListElement: [ - { - "@type": "ListItem", - position: 1, - name: "Home", - item: normalizeUrlForJsonLd(locale, "/"), - }, - { - "@type": "ListItem", - position: 2, - name: "Developers", - item: normalizeUrlForJsonLd(locale, "/developers/"), + "@type": "WebPage", + "@id": url, + name: t("page-local-environment-setup-meta-title"), + description: t("page-local-environment-setup-meta-desc"), + url: url, + inLanguage: locale, + contributor: contributorList, + author: [ethereumCommunityOrganization], + isPartOf: { + "@type": "WebSite", + "@id": "https://ethereum.org/#website", + name: "ethereum.org", + url: "https://ethereum.org", }, - { - "@type": "ListItem", - position: 3, - name: t("page-local-environment-setup-meta-title"), - item: url, + breadcrumb: { + "@type": "BreadcrumbList", + itemListElement: [ + { + "@type": "ListItem", + position: 1, + name: "Home", + item: normalizeUrlForJsonLd(locale, "/"), + }, + { + "@type": "ListItem", + position: 2, + name: "Developers", + item: normalizeUrlForJsonLd(locale, "/developers/"), + }, + { + "@type": "ListItem", + position: 3, + name: t("page-local-environment-setup-meta-title"), + item: url, + }, + ], }, - ], - }, - publisher: { - "@type": "Organization", - name: "ethereum.org", - url: "https://ethereum.org", - logo: { - "@type": "ImageObject", - url: "https://ethereum.org/images/eth-home-icon.png", + publisher: ethereumFoundationOrganization, + reviewedBy: ethereumFoundationOrganization, + mainEntity: { "@id": `${url}#local-environment` }, }, - }, - reviewedBy: { - "@type": "Organization", - name: "ethereum.org", - url: "https://ethereum.org", - logo: { - "@type": "ImageObject", - url: "https://ethereum.org/images/eth-home-icon.png", - }, - }, - } - - const developmentFrameworksJsonLd = { - "@context": "https://schema.org", - "@type": "ItemList", - name: "Ethereum Development Frameworks", - description: - "Tools and frameworks for setting up local Ethereum development environments", - url: url, - numberOfItems: frameworksListData.length, - itemListElement: frameworksListData.map((framework, index) => ({ - "@type": "SoftwareApplication", - position: index + 1, - name: framework.name, - description: framework.description, - url: framework.url, - applicationCategory: "DeveloperApplication", - operatingSystem: ["Windows", "macOS", "Linux"], - author: [ - { - "@type": "Organization", - name: framework.githubUrl || "Community", - }, - ], - downloadUrl: framework.url, - sameAs: framework.githubUrl, - })), - publisher: { - "@type": "Organization", - name: "ethereum.org", - url: "https://ethereum.org", - }, - reviewedBy: { - "@type": "Organization", - name: "ethereum.org", - url: "https://ethereum.org", - logo: { - "@type": "ImageObject", - url: "https://ethereum.org/images/eth-home-icon.png", + { + "@type": "ItemList", + "@id": `${url}#local-environment`, + name: "Ethereum Development Frameworks", + description: + "Tools and frameworks for setting up local Ethereum development environments", + url: url, + numberOfItems: frameworksListData.length, + itemListElement: frameworksListData.map((framework, index) => ({ + "@type": "SoftwareApplication", + position: index + 1, + name: framework.name, + description: framework.description, + url: framework.url, + applicationCategory: "DeveloperApplication", + operatingSystem: ["Windows", "macOS", "Linux"], + author: [ + { + "@type": "Organization", + name: framework.githubUrl || "Community", + }, + ], + downloadUrl: framework.url, + sameAs: framework.githubUrl, + })), + publisher: ethereumFoundationOrganization, + reviewedBy: ethereumFoundationOrganization, }, - }, + ], } - return ( - - ) + return } diff --git a/app/[locale]/developers/page-jsonld.tsx b/app/[locale]/developers/page-jsonld.tsx index ae9d15b45cc..5f4cb2b3928 100644 --- a/app/[locale]/developers/page-jsonld.tsx +++ b/app/[locale]/developers/page-jsonld.tsx @@ -4,6 +4,10 @@ import { CommunityConference, FileContributor } from "@/lib/types" import PageJsonLD from "@/components/PageJsonLD" +import { + ethereumCommunityOrganization, + ethereumFoundationOrganization, +} from "@/lib/utils/jsonld" import { normalizeUrlForJsonLd } from "@/lib/utils/url" import { DevelopersPath, VideoCourse } from "./types" @@ -31,108 +35,81 @@ export default async function DevelopersPageJsonLD({ url: contributor.html_url, })) - // JSON-LD structured data for the developers page - const webPageJsonLd = { + const jsonLd = { "@context": "https://schema.org", - "@type": "WebPage", - "@id": url, - name: t("page-developer-meta-title"), - description: t("page-developers-meta-desc"), - url: url, - inLanguage: locale, - contributor: contributorList, - author: [ + "@graph": [ { - "@type": "Organization", - name: "ethereum.org", - url: "https://ethereum.org", - }, - ], - breadcrumb: { - "@type": "BreadcrumbList", - itemListElement: [ - { - "@type": "ListItem", - position: 1, - name: "Home", - item: normalizeUrlForJsonLd(locale, "/"), + "@type": "WebPage", + "@id": url, + name: t("page-developer-meta-title"), + description: t("page-developers-meta-desc"), + url: url, + inLanguage: locale, + contributor: contributorList, + author: [ethereumCommunityOrganization], + isPartOf: { + "@type": "WebSite", + "@id": "https://ethereum.org/#website", + name: "ethereum.org", + url: "https://ethereum.org", }, - { - "@type": "ListItem", - position: 2, - name: t("page-developer-meta-title"), - item: normalizeUrlForJsonLd(locale, "/developers/"), + breadcrumb: { + "@type": "BreadcrumbList", + itemListElement: [ + { + "@type": "ListItem", + position: 1, + name: "Home", + item: normalizeUrlForJsonLd(locale, "/"), + }, + { + "@type": "ListItem", + position: 2, + name: t("page-developer-meta-title"), + item: normalizeUrlForJsonLd(locale, "/developers/"), + }, + ], }, - ], - }, - publisher: { - "@type": "Organization", - name: "ethereum.org", - url: "https://ethereum.org", - logo: { - "@type": "ImageObject", - url: "https://ethereum.org/images/eth-home-icon.png", + publisher: ethereumFoundationOrganization, + reviewedBy: ethereumFoundationOrganization, + mainEntity: { "@id": `${url}#developers` }, }, - }, - reviewedBy: { - "@type": "Organization", - name: "ethereum.org", - url: "https://ethereum.org", - logo: { - "@type": "ImageObject", - url: "https://ethereum.org/images/eth-home-icon.png", + { + "@type": "ItemList", + "@id": `${url}#developers`, + name: t("page-developer-meta-title"), + description: + "Comprehensive resources for building on Ethereum including tutorials, tools, documentation, and courses", + url: url, + numberOfItems: paths.length + courses.length + hackathons.length, + itemListElement: [ + ...paths.map((path, index) => ({ + "@type": "ListItem", + position: index + 1, + name: path.title, + description: path.description, + url: path.href, + })), + ...courses.slice(0, 5).map((course, index) => ({ + "@type": "ListItem", + position: paths.length + index + 1, + name: course.title, + description: course.description, + url: course.href, + })), + ...hackathons.map((hackathon, index) => ({ + "@type": "ListItem", + position: paths.length + courses.length + index + 1, + name: hackathon.title, + description: hackathon.description, + url: hackathon.href, + })), + ], + publisher: ethereumFoundationOrganization, + reviewedBy: ethereumFoundationOrganization, }, - }, - } - - const learningResourcesJsonLd = { - "@context": "https://schema.org", - "@type": "ItemList", - name: t("page-developer-meta-title"), - description: - "Comprehensive resources for building on Ethereum including tutorials, tools, documentation, and courses", - url: url, - numberOfItems: paths.length + courses.length + hackathons.length, - itemListElement: [ - ...paths.map((path, index) => ({ - "@type": "ListItem", - position: index + 1, - name: path.title, - description: path.description, - url: path.href, - })), - ...courses.slice(0, 5).map((course, index) => ({ - "@type": "ListItem", - position: paths.length + index + 1, - name: course.title, - description: course.description, - url: course.href, - })), - ...hackathons.map((hackathon, index) => ({ - "@type": "ListItem", - position: paths.length + courses.length + index + 1, - name: hackathon.title, - description: hackathon.description, - url: hackathon.href, - })), ], - publisher: { - "@type": "Organization", - name: "ethereum.org", - url: "https://ethereum.org", - }, - reviewedBy: { - "@type": "Organization", - name: "ethereum.org", - url: "https://ethereum.org", - logo: { - "@type": "ImageObject", - url: "https://ethereum.org/images/eth-home-icon.png", - }, - }, } - return ( - - ) + return } diff --git a/app/[locale]/developers/tutorials/page-jsonld.tsx b/app/[locale]/developers/tutorials/page-jsonld.tsx index 29a842dddc7..5cde1c24c35 100644 --- a/app/[locale]/developers/tutorials/page-jsonld.tsx +++ b/app/[locale]/developers/tutorials/page-jsonld.tsx @@ -4,6 +4,10 @@ import { FileContributor, ITutorial } from "@/lib/types" import PageJsonLD from "@/components/PageJsonLD" +import { + ethereumCommunityOrganization, + ethereumFoundationOrganization, +} from "@/lib/utils/jsonld" import { normalizeUrlForJsonLd } from "@/lib/utils/url" export default async function TutorialsPageJsonLD({ @@ -25,148 +29,102 @@ export default async function TutorialsPageJsonLD({ url: contributor.html_url, })) - // JSON-LD structured data for the developers tutorials page - const webPageJsonLd = { + const jsonLd = { "@context": "https://schema.org", - "@type": "WebPage", - "@id": url, - name: t("page-tutorials-meta-title"), - description: t("page-tutorials-meta-description"), - url: url, - inLanguage: locale, - contributor: contributorList, - author: [ + "@graph": [ { - "@type": "Organization", - name: "ethereum.org", - url: "https://ethereum.org", - }, - ], - breadcrumb: { - "@type": "BreadcrumbList", - itemListElement: [ - { - "@type": "ListItem", - position: 1, - name: "Home", - item: normalizeUrlForJsonLd(locale, "/"), + "@type": "WebPage", + "@id": url, + name: t("page-tutorials-meta-title"), + description: t("page-tutorials-meta-description"), + url: url, + inLanguage: locale, + contributor: contributorList, + author: [ethereumCommunityOrganization], + isPartOf: { + "@type": "WebSite", + "@id": "https://ethereum.org/#website", + name: "ethereum.org", + url: "https://ethereum.org", }, - { - "@type": "ListItem", - position: 2, - name: "Developers", - item: normalizeUrlForJsonLd(locale, "/developers/"), + breadcrumb: { + "@type": "BreadcrumbList", + itemListElement: [ + { + "@type": "ListItem", + position: 1, + name: "Home", + item: normalizeUrlForJsonLd(locale, "/"), + }, + { + "@type": "ListItem", + position: 2, + name: "Developers", + item: normalizeUrlForJsonLd(locale, "/developers/"), + }, + { + "@type": "ListItem", + position: 3, + name: t("page-tutorial-title"), + item: url, + }, + ], }, - { - "@type": "ListItem", - position: 3, - name: t("page-tutorial-title"), - item: url, - }, - ], - }, - publisher: { - "@type": "Organization", - name: "ethereum.org", - url: "https://ethereum.org", - logo: { - "@type": "ImageObject", - url: "https://ethereum.org/images/eth-home-icon.png", - }, - }, - reviewedBy: { - "@type": "Organization", - name: "ethereum.org", - url: "https://ethereum.org", - logo: { - "@type": "ImageObject", - url: "https://ethereum.org/images/eth-home-icon.png", - }, - }, - } - - const tutorialCollectionJsonLd = { - "@context": "https://schema.org", - "@type": "ItemList", - name: t("page-tutorial-title"), - description: t("page-tutorials-meta-description"), - url: url, - numberOfItems: internalTutorials.length, - itemListElement: internalTutorials.slice(0, 10).map((tutorial, index) => ({ - "@type": "ListItem", - position: index + 1, - name: tutorial.title, - description: tutorial.description, - url: tutorial.href, - })), - publisher: { - "@type": "Organization", - name: "ethereum.org", - url: "https://ethereum.org", - }, - reviewedBy: { - "@type": "Organization", - name: "ethereum.org", - url: "https://ethereum.org", - logo: { - "@type": "ImageObject", - url: "https://ethereum.org/images/eth-home-icon.png", + publisher: ethereumFoundationOrganization, + reviewedBy: ethereumFoundationOrganization, + mainEntity: { "@id": `${url}#tutorials` }, }, - }, - } - - const courseListJsonLd = { - "@context": "https://schema.org", - "@type": "ItemList", - name: t("page-tutorial-title"), - description: t("page-tutorials-meta-description"), - url: url, - numberOfItems: internalTutorials.length, - itemListElement: internalTutorials.slice(0, 10).map((tutorial, index) => ({ - "@type": "Course", - name: tutorial.title, - description: tutorial.description, - url: tutorial.href, - provider: { - "@type": "Organization", - name: "ethereum.org", - url: "https://ethereum.org", + { + "@type": "ItemList", + "@id": `${url}#tutorials`, + name: t("page-tutorial-title"), + description: t("page-tutorials-meta-description"), + url: url, + numberOfItems: internalTutorials.length, + itemListElement: internalTutorials + .slice(0, 10) + .map((tutorial, index) => ({ + "@type": "ListItem", + position: index + 1, + name: tutorial.title, + description: tutorial.description, + url: tutorial.href, + })), + publisher: ethereumFoundationOrganization, + reviewedBy: ethereumFoundationOrganization, }, - courseMode: "online", - educationalLevel: "beginner-intermediate", - inLanguage: locale, - isAccessibleForFree: true, - about: [ - "Ethereum Development", - "Smart Contracts", - "Blockchain Programming", - "Web3", - ], - position: index + 1, - })), - publisher: { - "@type": "Organization", - name: "ethereum.org", - url: "https://ethereum.org", - }, - reviewedBy: { - "@type": "Organization", - name: "ethereum.org", - url: "https://ethereum.org", - logo: { - "@type": "ImageObject", - url: "https://ethereum.org/images/eth-home-icon.png", + { + "@type": "ItemList", + "@id": `${url}#tutorials`, + name: t("page-tutorial-title"), + description: t("page-tutorials-meta-description"), + url: url, + numberOfItems: internalTutorials.length, + itemListElement: internalTutorials + .slice(0, 10) + .map((tutorial, index) => ({ + "@type": "Course", + name: tutorial.title, + description: tutorial.description, + url: tutorial.href, + provider: ethereumFoundationOrganization, + courseMode: "online", + educationalLevel: "beginner-intermediate", + inLanguage: locale, + isAccessibleForFree: true, + about: [ + "Ethereum Development", + "Smart Contracts", + "Blockchain Programming", + "Web3", + ], + position: index + 1, + })), + publisher: ethereumFoundationOrganization, + reviewedBy: ethereumFoundationOrganization, }, - }, + ], } - return ( - - ) + return } diff --git a/app/[locale]/ethereum-history-founder-and-ownership/page-jsonld.tsx b/app/[locale]/ethereum-history-founder-and-ownership/page-jsonld.tsx index 136a5c98fab..34279c862cd 100644 --- a/app/[locale]/ethereum-history-founder-and-ownership/page-jsonld.tsx +++ b/app/[locale]/ethereum-history-founder-and-ownership/page-jsonld.tsx @@ -4,6 +4,10 @@ import { FileContributor, Lang } from "@/lib/types" import PageJsonLD from "@/components/PageJsonLD" +import { + ethereumCommunityOrganization, + ethereumFoundationOrganization, +} from "@/lib/utils/jsonld" import { normalizeUrlForJsonLd } from "@/lib/utils/url" export default async function EthereumHistoryFounderAndOwnershipPageJsonLD({ @@ -30,112 +34,84 @@ export default async function EthereumHistoryFounderAndOwnershipPageJsonLD({ url: contributor.html_url, })) - // JSON-LD structured data for the Ethereum History, Founder and Ownership page - const webPageJsonLd = { + const jsonLd = { "@context": "https://schema.org", - "@type": "WebPage", - "@id": url, - name: t("page-ethereum-history-founder-and-ownership-meta-title"), - description: t( - "page-ethereum-history-founder-and-ownership-meta-description" - ), - url: url, - inLanguage: locale, - contributor: contributorList, - author: [ + "@graph": [ { - "@type": "Organization", - name: "ethereum.org", - url: "https://ethereum.org", - }, - ], - breadcrumb: { - "@type": "BreadcrumbList", - itemListElement: [ - { - "@type": "ListItem", - position: 1, - name: "Home", - item: normalizeUrlForJsonLd(locale, "/"), + "@type": "WebPage", + "@id": url, + name: t("page-ethereum-history-founder-and-ownership-meta-title"), + description: t( + "page-ethereum-history-founder-and-ownership-meta-description" + ), + url: url, + inLanguage: locale, + contributor: contributorList, + author: [ethereumCommunityOrganization], + isPartOf: { + "@type": "WebSite", + "@id": "https://ethereum.org/#website", + name: "ethereum.org", + url: "https://ethereum.org", }, - { - "@type": "ListItem", - position: 2, - name: t("page-ethereum-history-founder-and-ownership-title"), - item: url, + breadcrumb: { + "@type": "BreadcrumbList", + itemListElement: [ + { + "@type": "ListItem", + position: 1, + name: "Home", + item: normalizeUrlForJsonLd(locale, "/"), + }, + { + "@type": "ListItem", + position: 2, + name: t("page-ethereum-history-founder-and-ownership-title"), + item: url, + }, + ], }, - ], - }, - publisher: { - "@type": "Organization", - name: "ethereum.org", - url: "https://ethereum.org", - }, - reviewedBy: { - "@type": "Organization", - name: "ethereum.org", - url: "https://ethereum.org", - logo: { - "@type": "ImageObject", - url: "https://ethereum.org/images/eth-home-icon.png", - }, - }, - } - - // JSON-LD for the history and founder article content - const articleJsonLd = { - "@context": "https://schema.org", - "@type": "Article", - headline: t("page-ethereum-history-founder-and-ownership-title"), - description: t( - "page-ethereum-history-founder-and-ownership-meta-description" - ), - image: - "https://ethereum.org/images/ethereum-history-founder-and-ownership/ethereum-history-founder-and-ownership-hero.png", - author: [ - { - "@type": "Organization", - name: "ethereum.org", - url: "https://ethereum.org", - }, - ], - publisher: { - "@type": "Organization", - name: "ethereum.org", - url: "https://ethereum.org", - }, - contributor: contributorList, - reviewedBy: { - "@type": "Organization", - name: "ethereum.org", - url: "https://ethereum.org", - logo: { - "@type": "ImageObject", - url: "https://ethereum.org/images/eth-home-icon.png", - }, - }, - about: [ - { - "@type": "Thing", - name: "Ethereum", - description: - "A decentralized platform for applications and digital economies powered by smart contracts", - }, - { - "@type": "Person", - name: "Vitalik Buterin", - description: - "The founder of Ethereum who conceived the idea in late 2013 and published the Ethereum whitepaper in 2014", + publisher: ethereumFoundationOrganization, + reviewedBy: ethereumFoundationOrganization, + mainEntity: { "@id": `${url}#ethereum-history-founder-and-ownership` }, }, { - "@type": "Thing", - name: "Blockchain History", - description: - "The historical development and launch of the Ethereum blockchain network", + "@type": "Article", + "@id": `${url}#ethereum-history-founder-and-ownership`, + headline: t("page-ethereum-history-founder-and-ownership-title"), + description: t( + "page-ethereum-history-founder-and-ownership-meta-description" + ), + image: + "https://ethereum.org/images/ethereum-history-founder-and-ownership/ethereum-history-founder-and-ownership-hero.png", + author: [ethereumCommunityOrganization], + publisher: ethereumFoundationOrganization, + contributor: contributorList, + reviewedBy: ethereumFoundationOrganization, + about: [ + { + "@type": "Thing", + name: "Ethereum", + description: + "A decentralized platform for applications and digital economies powered by smart contracts", + }, + { + "@type": "Person", + name: "Vitalik Buterin", + description: + "The founder of Ethereum who conceived the idea in late 2013 and published the Ethereum whitepaper in 2014", + }, + { + "@type": "Thing", + name: "Blockchain History", + description: + "The historical development and launch of the Ethereum blockchain network", + }, + ], + dateModified: lastEditLocaleTimestamp, }, ], - dateModified: lastEditLocaleTimestamp, } - return + return } diff --git a/app/[locale]/ethereum-vs-bitcoin/page-jsonld.tsx b/app/[locale]/ethereum-vs-bitcoin/page-jsonld.tsx index 5544ac1cf3a..4f18ed1940f 100644 --- a/app/[locale]/ethereum-vs-bitcoin/page-jsonld.tsx +++ b/app/[locale]/ethereum-vs-bitcoin/page-jsonld.tsx @@ -4,6 +4,10 @@ import { FileContributor, Lang } from "@/lib/types" import PageJsonLD from "@/components/PageJsonLD" +import { + ethereumCommunityOrganization, + ethereumFoundationOrganization, +} from "@/lib/utils/jsonld" import { normalizeUrlForJsonLd } from "@/lib/utils/url" export default async function EthereumVsBitcoinPageJsonLD({ @@ -27,102 +31,74 @@ export default async function EthereumVsBitcoinPageJsonLD({ url: contributor.html_url, })) - // JSON-LD structured data for the Ethereum vs Bitcoin page - const webPageJsonLd = { + const jsonLd = { "@context": "https://schema.org", - "@type": "WebPage", - "@id": url, - name: t("page-ethereum-vs-bitcoin-meta-title"), - description: t("page-ethereum-vs-bitcoin-meta-description"), - url: url, - inLanguage: locale, - contributor: contributorList, - author: [ + "@graph": [ { - "@type": "Organization", - name: "ethereum.org", - url: "https://ethereum.org", - }, - ], - breadcrumb: { - "@type": "BreadcrumbList", - itemListElement: [ - { - "@type": "ListItem", - position: 1, - name: "Home", - item: normalizeUrlForJsonLd(locale, "/"), + "@type": "WebPage", + "@id": url, + name: t("page-ethereum-vs-bitcoin-meta-title"), + description: t("page-ethereum-vs-bitcoin-meta-description"), + url: url, + inLanguage: locale, + contributor: contributorList, + author: [ethereumCommunityOrganization], + isPartOf: { + "@type": "WebSite", + "@id": "https://ethereum.org/#website", + name: "ethereum.org", + url: "https://ethereum.org", }, - { - "@type": "ListItem", - position: 2, - name: t("page-ethereum-vs-bitcoin-title"), - item: url, + breadcrumb: { + "@type": "BreadcrumbList", + itemListElement: [ + { + "@type": "ListItem", + position: 1, + name: "Home", + item: normalizeUrlForJsonLd(locale, "/"), + }, + { + "@type": "ListItem", + position: 2, + name: t("page-ethereum-vs-bitcoin-title"), + item: url, + }, + ], }, - ], - }, - publisher: { - "@type": "Organization", - name: "ethereum.org", - url: "https://ethereum.org", - }, - reviewedBy: { - "@type": "Organization", - name: "ethereum.org", - url: "https://ethereum.org", - logo: { - "@type": "ImageObject", - url: "https://ethereum.org/images/eth-home-icon.png", - }, - }, - } - - // JSON-LD for the comparison article content - const articleJsonLd = { - "@context": "https://schema.org", - "@type": "Article", - headline: t("page-ethereum-vs-bitcoin-title"), - description: t("page-ethereum-vs-bitcoin-meta-description"), - image: - "https://ethereum.org/images/ethereum-vs-bitcoin/bitcoin-vs-ethereum-robots.png", - author: [ - { - "@type": "Organization", - name: "ethereum.org", - url: "https://ethereum.org", - }, - ], - publisher: { - "@type": "Organization", - name: "ethereum.org", - url: "https://ethereum.org", - }, - contributor: contributorList, - reviewedBy: { - "@type": "Organization", - name: "ethereum.org", - url: "https://ethereum.org", - logo: { - "@type": "ImageObject", - url: "https://ethereum.org/images/eth-home-icon.png", - }, - }, - about: [ - { - "@type": "Thing", - name: "Ethereum", - description: - "A decentralized platform for applications and digital economies powered by smart contracts", + publisher: ethereumFoundationOrganization, + reviewedBy: ethereumFoundationOrganization, + mainEntity: { "@id": `${url}#ethereum-vs-bitcoin` }, }, { - "@type": "Thing", - name: "Bitcoin", - description: - "A peer-to-peer digital currency system and the first decentralized cryptocurrency", + "@type": "Article", + "@id": `${url}#ethereum-vs-bitcoin`, + headline: t("page-ethereum-vs-bitcoin-title"), + description: t("page-ethereum-vs-bitcoin-meta-description"), + image: + "https://ethereum.org/images/ethereum-vs-bitcoin/bitcoin-vs-ethereum-robots.png", + author: [ethereumCommunityOrganization], + publisher: ethereumFoundationOrganization, + contributor: contributorList, + reviewedBy: ethereumFoundationOrganization, + about: [ + { + "@type": "Thing", + name: "Ethereum", + description: + "A decentralized platform for applications and digital economies powered by smart contracts", + }, + { + "@type": "Thing", + name: "Bitcoin", + description: + "A peer-to-peer digital currency system and the first decentralized cryptocurrency", + }, + ], + dateModified: lastEditLocaleTimestamp, }, ], - dateModified: lastEditLocaleTimestamp, } - return + return } diff --git a/app/[locale]/founders/page-jsonld.tsx b/app/[locale]/founders/page-jsonld.tsx index e47b6880f20..619947d11f7 100644 --- a/app/[locale]/founders/page-jsonld.tsx +++ b/app/[locale]/founders/page-jsonld.tsx @@ -4,6 +4,10 @@ import { FileContributor } from "@/lib/types" import PageJsonLD from "@/components/PageJsonLD" +import { + ethereumCommunityOrganization, + ethereumFoundationOrganization, +} from "@/lib/utils/jsonld" import { normalizeUrlForJsonLd } from "@/lib/utils/url" export default async function FoundersPageJsonLD({ @@ -25,59 +29,46 @@ export default async function FoundersPageJsonLD({ url: contributor.html_url, })) - // JSON-LD structured data for the founders page - const webPageJsonLd = { + const jsonLd = { "@context": "https://schema.org", - "@type": "WebPage", - "@id": url, - name: t("page-founders-metadata-title"), - description: t("page-founders-metadata-description"), - url: url, - inLanguage: locale, - contributor: contributorList, - author: [ + "@graph": [ { - "@type": "Organization", - name: "ethereum.org", - url: "https://ethereum.org", - }, - ], - breadcrumb: { - "@type": "BreadcrumbList", - itemListElement: [ - { - "@type": "ListItem", - position: 1, - name: "Home", - item: normalizeUrlForJsonLd(locale, "/"), + "@type": "WebPage", + "@id": url, + name: t("page-founders-metadata-title"), + description: t("page-founders-metadata-description"), + url: url, + inLanguage: locale, + contributor: contributorList, + author: [ethereumCommunityOrganization], + isPartOf: { + "@type": "WebSite", + "@id": "https://ethereum.org/#website", + name: "ethereum.org", + url: "https://ethereum.org", }, - { - "@type": "ListItem", - position: 2, - name: t("page-founders-metadata-title"), - item: normalizeUrlForJsonLd(locale, "/founders/"), + breadcrumb: { + "@type": "BreadcrumbList", + itemListElement: [ + { + "@type": "ListItem", + position: 1, + name: "Home", + item: normalizeUrlForJsonLd(locale, "/"), + }, + { + "@type": "ListItem", + position: 2, + name: t("page-founders-metadata-title"), + item: normalizeUrlForJsonLd(locale, "/founders/"), + }, + ], }, - ], - }, - publisher: { - "@type": "Organization", - name: "ethereum.org", - url: "https://ethereum.org", - logo: { - "@type": "ImageObject", - url: "https://ethereum.org/images/eth-home-icon.png", + publisher: ethereumFoundationOrganization, + reviewedBy: ethereumFoundationOrganization, }, - }, - reviewedBy: { - "@type": "Organization", - name: "ethereum.org", - url: "https://ethereum.org", - logo: { - "@type": "ImageObject", - url: "https://ethereum.org/images/eth-home-icon.png", - }, - }, + ], } - return + return } diff --git a/app/[locale]/gas/page-jsonld.tsx b/app/[locale]/gas/page-jsonld.tsx index a7972dc3bb3..ba5f5d882a5 100644 --- a/app/[locale]/gas/page-jsonld.tsx +++ b/app/[locale]/gas/page-jsonld.tsx @@ -4,6 +4,10 @@ import { FileContributor, Lang } from "@/lib/types" import PageJsonLD from "@/components/PageJsonLD" +import { + ethereumCommunityOrganization, + ethereumFoundationOrganization, +} from "@/lib/utils/jsonld" import { normalizeUrlForJsonLd } from "@/lib/utils/url" export default async function GasPageJsonLD({ @@ -27,90 +31,58 @@ export default async function GasPageJsonLD({ url: contributor.html_url, })) - // JSON-LD structured data for the gas page - const webPageJsonLd = { + const jsonLd = { "@context": "https://schema.org", - "@type": "WebPage", - "@id": url, - name: t("page-gas-meta-title"), - description: t("page-gas-meta-description"), - url: url, - inLanguage: locale, - contributor: contributorList, - author: [ + "@graph": [ { - "@type": "Organization", - name: "ethereum.org", - url: "https://ethereum.org", - }, - ], - breadcrumb: { - "@type": "BreadcrumbList", - itemListElement: [ - { - "@type": "ListItem", - position: 1, - name: "Home", - item: normalizeUrlForJsonLd(locale, "/"), + "@type": "WebPage", + "@id": url, + name: t("page-gas-meta-title"), + description: t("page-gas-meta-description"), + url: url, + inLanguage: locale, + contributor: contributorList, + author: [ethereumCommunityOrganization], + isPartOf: { + "@type": "WebSite", + "@id": "https://ethereum.org/#website", + name: "ethereum.org", + url: "https://ethereum.org", }, - { - "@type": "ListItem", - position: 2, - name: t("page-gas-meta-title"), - item: normalizeUrlForJsonLd(locale, "/gas/"), + breadcrumb: { + "@type": "BreadcrumbList", + itemListElement: [ + { + "@type": "ListItem", + position: 1, + name: "Home", + item: normalizeUrlForJsonLd(locale, "/"), + }, + { + "@type": "ListItem", + position: 2, + name: t("page-gas-meta-title"), + item: normalizeUrlForJsonLd(locale, "/gas/"), + }, + ], }, - ], - }, - publisher: { - "@type": "Organization", - name: "ethereum.org", - url: "https://ethereum.org", - }, - reviewedBy: { - "@type": "Organization", - name: "ethereum.org", - url: "https://ethereum.org", - logo: { - "@type": "ImageObject", - url: "https://ethereum.org/images/eth-home-icon.png", + publisher: ethereumFoundationOrganization, + reviewedBy: ethereumFoundationOrganization, + mainEntity: { "@id": `${url}#gas` }, }, - }, - } - - // JSON-LD for the article content about gas - const articleJsonLd = { - "@context": "https://schema.org", - "@type": "Article", - headline: t("page-gas-hero-title"), - description: t("page-gas-meta-description"), - contributor: contributorList, - author: [ { - "@type": "Organization", - name: "ethereum.org", - url: "https://ethereum.org", + "@type": "Article", + "@id": `${url}#gas`, + headline: t("page-gas-hero-title"), + description: t("page-gas-meta-description"), + contributor: contributorList, + author: [ethereumCommunityOrganization], + publisher: ethereumFoundationOrganization, + reviewedBy: ethereumFoundationOrganization, + dateModified: lastEditLocaleTimestamp, }, ], - publisher: { - "@type": "Organization", - name: "ethereum.org", - url: "https://ethereum.org", - }, - reviewedBy: { - "@type": "Organization", - name: "ethereum.org", - url: "https://ethereum.org", - logo: { - "@type": "ImageObject", - url: "https://ethereum.org/images/eth-home-icon.png", - }, - }, - dateModified: lastEditLocaleTimestamp, - mainEntityOfPage: { - "@type": "WebPage", - "@id": url, - }, } - return + return } diff --git a/app/[locale]/get-eth/page-jsonld.tsx b/app/[locale]/get-eth/page-jsonld.tsx index 4ed5c49f0fb..6d4dd4e028c 100644 --- a/app/[locale]/get-eth/page-jsonld.tsx +++ b/app/[locale]/get-eth/page-jsonld.tsx @@ -4,6 +4,10 @@ import { FileContributor, Lang } from "@/lib/types" import PageJsonLD from "@/components/PageJsonLD" +import { + ethereumCommunityOrganization, + ethereumFoundationOrganization, +} from "@/lib/utils/jsonld" import { normalizeUrlForJsonLd } from "@/lib/utils/url" export default async function GetEthPageJsonLD({ @@ -27,87 +31,59 @@ export default async function GetEthPageJsonLD({ url: contributor.html_url, })) - // JSON-LD structured data for the get-eth page - const webPageJsonLd = { + const jsonLd = { "@context": "https://schema.org", - "@type": "WebPage", - "@id": url, - name: t("page-get-eth-meta-title"), - description: t("page-get-eth-meta-description"), - url: url, - inLanguage: locale, - contributor: contributorList, - author: [ + "@graph": [ { - "@type": "Organization", - name: "ethereum.org", - url: "https://ethereum.org", - }, - ], - breadcrumb: { - "@type": "BreadcrumbList", - itemListElement: [ - { - "@type": "ListItem", - position: 1, - name: "Home", - item: normalizeUrlForJsonLd(locale, "/"), + "@type": "WebPage", + "@id": url, + name: t("page-get-eth-meta-title"), + description: t("page-get-eth-meta-description"), + url: url, + inLanguage: locale, + contributor: contributorList, + author: [ethereumCommunityOrganization], + isPartOf: { + "@type": "WebSite", + "@id": "https://ethereum.org/#website", + name: "ethereum.org", + url: "https://ethereum.org", }, - { - "@type": "ListItem", - position: 2, - name: t("page-get-eth-meta-title"), - item: normalizeUrlForJsonLd(locale, "/get-eth/"), + breadcrumb: { + "@type": "BreadcrumbList", + itemListElement: [ + { + "@type": "ListItem", + position: 1, + name: "Home", + item: normalizeUrlForJsonLd(locale, "/"), + }, + { + "@type": "ListItem", + position: 2, + name: t("page-get-eth-meta-title"), + item: normalizeUrlForJsonLd(locale, "/get-eth/"), + }, + ], }, - ], - }, - publisher: { - "@type": "Organization", - name: "ethereum.org", - url: "https://ethereum.org", - }, - reviewedBy: { - "@type": "Organization", - name: "ethereum.org", - url: "https://ethereum.org", - logo: { - "@type": "ImageObject", - url: "https://ethereum.org/images/eth-home-icon.png", + publisher: ethereumFoundationOrganization, + reviewedBy: ethereumFoundationOrganization, + mainEntity: { "@id": `${url}#get-eth` }, }, - }, - } - - // JSON-LD for the article content about getting ETH - const articleJsonLd = { - "@context": "https://schema.org", - "@type": "Article", - headline: t("page-get-eth-where-to-buy-title"), - description: t("page-get-eth-meta-description"), - image: "https://ethereum.org/images/get-eth.png", // TODO: adjust value when the old theme breakpoints are removed (src/theme.ts) - contributor: contributorList, - author: [ { - "@type": "Organization", - name: "ethereum.org", - url: "https://ethereum.org", + "@type": "Article", + "@id": `${url}#get-eth`, + headline: t("page-get-eth-where-to-buy-title"), + description: t("page-get-eth-meta-description"), + image: "https://ethereum.org/images/get-eth.png", // TODO: adjust value when the old theme breakpoints are removed (src/theme.ts) + contributor: contributorList, + author: [ethereumCommunityOrganization], + publisher: ethereumFoundationOrganization, + reviewedBy: ethereumFoundationOrganization, + dateModified: lastEditLocaleTimestamp, }, ], - publisher: { - "@type": "Organization", - name: "ethereum.org", - url: "https://ethereum.org", - }, - reviewedBy: { - "@type": "Organization", - name: "ethereum.org", - url: "https://ethereum.org", - logo: { - "@type": "ImageObject", - url: "https://ethereum.org/images/eth-home-icon.png", - }, - }, - dateModified: lastEditLocaleTimestamp, } - return + return } diff --git a/app/[locale]/layer-2/learn/page-jsonld.tsx b/app/[locale]/layer-2/learn/page-jsonld.tsx index ca37ab0cfd9..e593a3c9991 100644 --- a/app/[locale]/layer-2/learn/page-jsonld.tsx +++ b/app/[locale]/layer-2/learn/page-jsonld.tsx @@ -4,6 +4,10 @@ import { FileContributor, Lang } from "@/lib/types" import PageJsonLD from "@/components/PageJsonLD" +import { + ethereumCommunityOrganization, + ethereumFoundationOrganization, +} from "@/lib/utils/jsonld" import { normalizeUrlForJsonLd } from "@/lib/utils/url" export default async function Layer2LearnPageJsonLD({ @@ -27,93 +31,65 @@ export default async function Layer2LearnPageJsonLD({ url: contributor.html_url, })) - // JSON-LD structured data for the Layer 2 Learn page - const webPageJsonLd = { + const jsonLd = { "@context": "https://schema.org", - "@type": "WebPage", - "@id": url, - name: t("page-layer-2-learn-meta-title"), - description: t("page-layer-2-learn-description"), - url: url, - inLanguage: locale, - contributor: contributorList, - author: [ + "@graph": [ { - "@type": "Organization", - name: "ethereum.org", - url: "https://ethereum.org", - }, - ], - breadcrumb: { - "@type": "BreadcrumbList", - itemListElement: [ - { - "@type": "ListItem", - position: 1, - name: "Home", - item: normalizeUrlForJsonLd(locale, "/"), + "@type": "WebPage", + "@id": url, + name: t("page-layer-2-learn-meta-title"), + description: t("page-layer-2-learn-description"), + url: url, + inLanguage: locale, + contributor: contributorList, + author: [ethereumCommunityOrganization], + isPartOf: { + "@type": "WebSite", + "@id": "https://ethereum.org/#website", + name: "ethereum.org", + url: "https://ethereum.org", }, - { - "@type": "ListItem", - position: 2, - name: "Layer 2", - item: normalizeUrlForJsonLd(locale, "/layer-2/"), + breadcrumb: { + "@type": "BreadcrumbList", + itemListElement: [ + { + "@type": "ListItem", + position: 1, + name: "Home", + item: normalizeUrlForJsonLd(locale, "/"), + }, + { + "@type": "ListItem", + position: 2, + name: "Layer 2", + item: normalizeUrlForJsonLd(locale, "/layer-2/"), + }, + { + "@type": "ListItem", + position: 3, + name: t("page-layer-2-learn-meta-title"), + item: url, + }, + ], }, - { - "@type": "ListItem", - position: 3, - name: t("page-layer-2-learn-meta-title"), - item: url, - }, - ], - }, - publisher: { - "@type": "Organization", - name: "ethereum.org", - url: "https://ethereum.org", - }, - reviewedBy: { - "@type": "Organization", - name: "ethereum.org", - url: "https://ethereum.org", - logo: { - "@type": "ImageObject", - url: "https://ethereum.org/images/eth-home-icon.png", + publisher: ethereumFoundationOrganization, + reviewedBy: ethereumFoundationOrganization, + mainEntity: { "@id": `${url}#layer-2-learn` }, }, - }, - } - - // JSON-LD for the article content about learning Layer 2 - const articleJsonLd = { - "@context": "https://schema.org", - "@type": "Article", - headline: t("page-layer-2-learn-title"), - description: t("page-layer-2-learn-description"), - image: "https://ethereum.org/images/layer-2/learn-hero.png", // TODO: adjust value when the old theme breakpoints are removed (src/theme.ts) - author: [ { - "@type": "Organization", - name: "ethereum.org", - url: "https://ethereum.org", + "@type": "Article", + "@id": `${url}#layer-2-learn`, + headline: t("page-layer-2-learn-title"), + description: t("page-layer-2-learn-description"), + image: "https://ethereum.org/images/layer-2/learn-hero.png", // TODO: adjust value when the old theme breakpoints are removed (src/theme.ts) + author: [ethereumCommunityOrganization], + publisher: ethereumFoundationOrganization, + contributor: contributorList, + reviewedBy: ethereumFoundationOrganization, + dateModified: lastEditLocaleTimestamp, }, ], - publisher: { - "@type": "Organization", - name: "ethereum.org", - url: "https://ethereum.org", - }, - contributor: contributorList, - reviewedBy: { - "@type": "Organization", - name: "ethereum.org", - url: "https://ethereum.org", - logo: { - "@type": "ImageObject", - url: "https://ethereum.org/images/eth-home-icon.png", - }, - }, - dateModified: lastEditLocaleTimestamp, } - return + return } diff --git a/app/[locale]/layer-2/networks/page-jsonld.tsx b/app/[locale]/layer-2/networks/page-jsonld.tsx index f246208efb7..6f4354e8f0b 100644 --- a/app/[locale]/layer-2/networks/page-jsonld.tsx +++ b/app/[locale]/layer-2/networks/page-jsonld.tsx @@ -2,6 +2,10 @@ import { getTranslations } from "next-intl/server" import PageJsonLD from "@/components/PageJsonLD" +import { + ethereumCommunityOrganization, + ethereumFoundationOrganization, +} from "@/lib/utils/jsonld" import { normalizeUrlForJsonLd } from "@/lib/utils/url" export default async function Layer2NetworksPageJsonLD({ @@ -21,114 +25,103 @@ export default async function Layer2NetworksPageJsonLD({ url: contributor.html_url, })) - // JSON-LD structured data for the Layer 2 Networks page - const webPageJsonLd = { + const jsonLd = { "@context": "https://schema.org", - "@type": "WebPage", - "@id": url, - name: t("page-layer-2-networks-meta-title"), - description: t("page-layer-2-networks-hero-description"), - url: url, - inLanguage: locale, - contributor: contributorList, - author: [ + "@graph": [ { - "@type": "Organization", - name: "ethereum.org", - url: "https://ethereum.org", - }, - ], - breadcrumb: { - "@type": "BreadcrumbList", - itemListElement: [ - { - "@type": "ListItem", - position: 1, - name: "Home", - item: normalizeUrlForJsonLd(locale, "/"), + "@type": "WebPage", + "@id": url, + name: t("page-layer-2-networks-meta-title"), + description: t("page-layer-2-networks-hero-description"), + url: url, + inLanguage: locale, + contributor: contributorList, + author: [ethereumCommunityOrganization], + isPartOf: { + "@type": "WebSite", + "@id": "https://ethereum.org/#website", + name: "ethereum.org", + url: "https://ethereum.org", }, - { - "@type": "ListItem", - position: 2, - name: "Layer 2", - item: normalizeUrlForJsonLd(locale, "/layer-2/"), + breadcrumb: { + "@type": "BreadcrumbList", + itemListElement: [ + { + "@type": "ListItem", + position: 1, + name: "Home", + item: normalizeUrlForJsonLd(locale, "/"), + }, + { + "@type": "ListItem", + position: 2, + name: "Layer 2", + item: normalizeUrlForJsonLd(locale, "/layer-2/"), + }, + { + "@type": "ListItem", + position: 3, + name: t("page-layer-2-networks-meta-title"), + item: url, + }, + ], }, - { - "@type": "ListItem", - position: 3, - name: t("page-layer-2-networks-meta-title"), - item: url, - }, - ], - }, - publisher: { - "@type": "Organization", - name: "ethereum.org", - url: "https://ethereum.org", - logo: { - "@type": "ImageObject", - url: "https://ethereum.org/images/eth-home-icon.png", - }, - }, - reviewedBy: { - "@type": "Organization", - name: "ethereum.org", - url: "https://ethereum.org", - logo: { - "@type": "ImageObject", - url: "https://ethereum.org/images/eth-home-icon.png", + publisher: ethereumFoundationOrganization, + reviewedBy: ethereumFoundationOrganization, + mainEntity: { "@id": `${url}#networks-list` }, }, - }, - } - - // JSON-LD for Layer 2 Networks listing - const networksItemListJsonLd = { - "@context": "https://schema.org", - "@type": "ItemList", - name: t("page-layer-2-networks-meta-title"), - description: t("page-layer-2-networks-hero-description"), - numberOfItems: layer2Data.length, - itemListElement: layer2Data.map((network, index) => ({ - "@type": "ListItem", - position: index + 1, - item: { - "@type": "SoftwareApplication", - name: network.name, - description: - network.description || `${network.name} Layer 2 network on Ethereum`, - url: network.website, - applicationCategory: "Blockchain Network", - operatingSystem: "Ethereum", - additionalProperty: [ - { - "@type": "PropertyValue", - name: "Network Type", - value: network.rollupType || "Layer 2", - }, - { - "@type": "PropertyValue", - name: "Maturity Level", - value: network.networkMaturity, - }, - { - "@type": "PropertyValue", - name: "Total Value Locked (TVL)", - value: network.tvl ? `$${network.tvl.toLocaleString()}` : "N/A", - }, - { - "@type": "PropertyValue", - name: "Daily Transaction Cost", - value: network.txCosts ? `$${network.txCosts.toFixed(2)}` : "N/A", - }, - { - "@type": "PropertyValue", - name: "Supported Wallets", - value: network.walletsSupportedCount || "N/A", + { + "@type": "ItemList", + "@id": `${url}#networks-list`, + name: t("page-layer-2-networks-meta-title"), + description: t("page-layer-2-networks-hero-description"), + numberOfItems: layer2Data.length, + itemListElement: layer2Data.map((network, index) => ({ + "@type": "ListItem", + position: index + 1, + item: { + "@type": "SoftwareApplication", + name: network.name, + description: + network.description || + `${network.name} Layer 2 network on Ethereum`, + url: network.website, + applicationCategory: "Blockchain Network", + operatingSystem: "Ethereum", + additionalProperty: [ + { + "@type": "PropertyValue", + name: "Network Type", + value: network.rollupType || "Layer 2", + }, + { + "@type": "PropertyValue", + name: "Maturity Level", + value: network.networkMaturity, + }, + { + "@type": "PropertyValue", + name: "Total Value Locked (TVL)", + value: network.tvl ? `$${network.tvl.toLocaleString()}` : "N/A", + }, + { + "@type": "PropertyValue", + name: "Daily Transaction Cost", + value: network.txCosts + ? `$${network.txCosts.toFixed(2)}` + : "N/A", + }, + { + "@type": "PropertyValue", + name: "Supported Wallets", + value: network.walletsSupportedCount || "N/A", + }, + ], }, - ], + })), }, - })), + ], } - return + return } diff --git a/app/[locale]/layer-2/page-jsonld.tsx b/app/[locale]/layer-2/page-jsonld.tsx index 0a081f83cc9..23b6156b058 100644 --- a/app/[locale]/layer-2/page-jsonld.tsx +++ b/app/[locale]/layer-2/page-jsonld.tsx @@ -4,6 +4,10 @@ import { FileContributor, Lang } from "@/lib/types" import PageJsonLD from "@/components/PageJsonLD" +import { + ethereumCommunityOrganization, + ethereumFoundationOrganization, +} from "@/lib/utils/jsonld" import { normalizeUrlForJsonLd } from "@/lib/utils/url" export default async function Layer2PageJsonLD({ @@ -25,128 +29,96 @@ export default async function Layer2PageJsonLD({ url: contributor.html_url, })) - // JSON-LD structured data for the Layer 2 page - const webPageJsonLd = { + const jsonLd = { "@context": "https://schema.org", - "@type": "WebPage", - "@id": url, - name: t("page-layer-2-meta-title"), - description: t("page-layer-2-meta-description"), - url: url, - inLanguage: locale, - contributor: contributorList, - author: [ + "@graph": [ { - "@type": "Organization", - name: "ethereum.org", - url: "https://ethereum.org", - }, - ], - breadcrumb: { - "@type": "BreadcrumbList", - itemListElement: [ - { - "@type": "ListItem", - position: 1, - name: "Home", - item: normalizeUrlForJsonLd(locale, "/"), - }, - { - "@type": "ListItem", - position: 2, - name: t("page-layer-2-meta-title"), - item: url, - }, - ], - }, - publisher: { - "@type": "Organization", - name: "ethereum.org", - url: "https://ethereum.org", - }, - reviewedBy: { - "@type": "Organization", - name: "ethereum.org", - url: "https://ethereum.org", - logo: { - "@type": "ImageObject", - url: "https://ethereum.org/images/eth-home-icon.png", - }, - }, - } - - // JSON-LD for the article content about Layer 2 - const articleJsonLd = { - "@context": "https://schema.org", - "@type": "Article", - headline: t("page-layer-2-hero-title"), - description: t("page-layer-2-meta-description"), - image: "https://ethereum.org/images/layer-2/learn-hero.png", // TODO: adjust value when the old theme breakpoints are removed (src/theme.ts) - author: [ - { - "@type": "Organization", - name: "ethereum.org", - url: "https://ethereum.org", - }, - ], - contributor: contributorList, - publisher: { - "@type": "Organization", - name: "ethereum.org", - url: "https://ethereum.org", - }, - reviewedBy: { - "@type": "Organization", - name: "ethereum.org", - url: "https://ethereum.org", - logo: { - "@type": "ImageObject", - url: "https://ethereum.org/images/eth-home-icon.png", - }, - }, - } - - // JSON-LD for FAQ section - const faqJsonLd = { - "@context": "https://schema.org", - "@type": "FAQPage", - mainEntity: [ - { - "@type": "Question", - name: t("page-layer-2-faq-ExpandableCard-1-title"), - acceptedAnswer: { - "@type": "Answer", - text: `${t("page-layer-2-faq-ExpandableCard-1-description-1")} ${t("page-layer-2-faq-ExpandableCard-1-description-2")}`, + "@type": "WebPage", + "@id": url, + name: t("page-layer-2-meta-title"), + description: t("page-layer-2-meta-description"), + url: url, + inLanguage: locale, + contributor: contributorList, + author: [ethereumCommunityOrganization], + isPartOf: { + "@type": "WebSite", + "@id": "https://ethereum.org/#website", + name: "ethereum.org", + url: "https://ethereum.org", }, - }, - { - "@type": "Question", - name: t("page-layer-2-faq-ExpandableCard-2-title"), - acceptedAnswer: { - "@type": "Answer", - text: `${t("page-layer-2-faq-ExpandableCard-2-description-1")} ${t("page-layer-2-faq-ExpandableCard-2-description-2")}`, + breadcrumb: { + "@type": "BreadcrumbList", + itemListElement: [ + { + "@type": "ListItem", + position: 1, + name: "Home", + item: normalizeUrlForJsonLd(locale, "/"), + }, + { + "@type": "ListItem", + position: 2, + name: t("page-layer-2-meta-title"), + item: url, + }, + ], }, + publisher: ethereumFoundationOrganization, + reviewedBy: ethereumFoundationOrganization, + mainEntity: { "@id": `${url}#layer-2` }, }, { - "@type": "Question", - name: t("page-layer-2-faq-ExpandableCard-3-title"), - acceptedAnswer: { - "@type": "Answer", - text: t("page-layer-2-faq-ExpandableCard-3-description"), - }, + "@type": "Article", + "@id": `${url}#layer-2`, + headline: t("page-layer-2-hero-title"), + description: t("page-layer-2-meta-description"), + image: "https://ethereum.org/images/layer-2/learn-hero.png", // TODO: adjust value when the old theme breakpoints are removed (src/theme.ts) + author: [ethereumCommunityOrganization], + contributor: contributorList, + publisher: ethereumFoundationOrganization, + reviewedBy: ethereumFoundationOrganization, }, { - "@type": "Question", - name: t("page-layer-2-faq-ExpandableCard-4-title"), - acceptedAnswer: { - "@type": "Answer", - text: t("page-layer-2-faq-ExpandableCard-4-description"), - }, + "@type": "FAQPage", + "@id": `${url}#layer-2-faq`, + mainEntity: [ + { + "@type": "Question", + name: t("page-layer-2-faq-ExpandableCard-1-title"), + acceptedAnswer: { + "@type": "Answer", + text: `${t("page-layer-2-faq-ExpandableCard-1-description-1")} ${t("page-layer-2-faq-ExpandableCard-1-description-2")}`, + }, + }, + { + "@type": "Question", + name: t("page-layer-2-faq-ExpandableCard-2-title"), + acceptedAnswer: { + "@type": "Answer", + text: `${t("page-layer-2-faq-ExpandableCard-2-description-1")} ${t("page-layer-2-faq-ExpandableCard-2-description-2")}`, + }, + }, + { + "@type": "Question", + name: t("page-layer-2-faq-ExpandableCard-3-title"), + acceptedAnswer: { + "@type": "Answer", + text: t("page-layer-2-faq-ExpandableCard-3-description"), + }, + }, + { + "@type": "Question", + name: t("page-layer-2-faq-ExpandableCard-4-title"), + acceptedAnswer: { + "@type": "Answer", + text: t("page-layer-2-faq-ExpandableCard-4-description"), + }, + }, + ], }, ], } - return ( - - ) + return } diff --git a/app/[locale]/learn/page-jsonld.tsx b/app/[locale]/learn/page-jsonld.tsx index d5ea98aa5e6..b1ee6f17792 100644 --- a/app/[locale]/learn/page-jsonld.tsx +++ b/app/[locale]/learn/page-jsonld.tsx @@ -2,6 +2,10 @@ import { getTranslations } from "next-intl/server" import PageJsonLD from "@/components/PageJsonLD" +import { + ethereumCommunityOrganization, + ethereumFoundationOrganization, +} from "@/lib/utils/jsonld" import { normalizeUrlForJsonLd } from "@/lib/utils/url" export default async function LearnPageJsonLD({ locale, contributors }) { @@ -17,59 +21,46 @@ export default async function LearnPageJsonLD({ locale, contributors }) { url: contributor.html_url, })) - // JSON-LD structured data for the Learn page - const webPageJsonLd = { + const jsonLd = { "@context": "https://schema.org", - "@type": "WebPage", - "@id": url, - name: t("page-learn-meta-title"), - description: t("hero-subtitle"), - url: url, - inLanguage: locale, - contributor: contributorList, - author: [ + "@graph": [ { - "@type": "Organization", - name: "ethereum.org", - url: "https://ethereum.org", - }, - ], - breadcrumb: { - "@type": "BreadcrumbList", - itemListElement: [ - { - "@type": "ListItem", - position: 1, - name: "Home", - item: normalizeUrlForJsonLd(locale, "/"), + "@type": "WebPage", + "@id": url, + name: t("page-learn-meta-title"), + description: t("hero-subtitle"), + url: url, + inLanguage: locale, + contributor: contributorList, + author: [ethereumCommunityOrganization], + isPartOf: { + "@type": "WebSite", + "@id": "https://ethereum.org/#website", + name: "ethereum.org", + url: "https://ethereum.org", }, - { - "@type": "ListItem", - position: 2, - name: t("page-learn-meta-title"), - item: url, + breadcrumb: { + "@type": "BreadcrumbList", + itemListElement: [ + { + "@type": "ListItem", + position: 1, + name: "Home", + item: normalizeUrlForJsonLd(locale, "/"), + }, + { + "@type": "ListItem", + position: 2, + name: t("page-learn-meta-title"), + item: url, + }, + ], }, - ], - }, - publisher: { - "@type": "Organization", - name: "ethereum.org", - url: "https://ethereum.org", - logo: { - "@type": "ImageObject", - url: "https://ethereum.org/images/eth-home-icon.png", + publisher: ethereumFoundationOrganization, + reviewedBy: ethereumFoundationOrganization, }, - }, - reviewedBy: { - "@type": "Organization", - name: "ethereum.org", - url: "https://ethereum.org", - logo: { - "@type": "ImageObject", - url: "https://ethereum.org/images/eth-home-icon.png", - }, - }, + ], } - return + return } diff --git a/app/[locale]/page-jsonld.tsx b/app/[locale]/page-jsonld.tsx index 4d40498b033..cb5912950a7 100644 --- a/app/[locale]/page-jsonld.tsx +++ b/app/[locale]/page-jsonld.tsx @@ -4,6 +4,11 @@ import { Lang } from "@/lib/types" import PageJsonLD from "@/components/PageJsonLD" +import { + ethereumCommunityOrganization, + ethereumFoundationOrganization, + ethereumFoundationReference, +} from "@/lib/utils/jsonld" import { normalizeUrlForJsonLd } from "@/lib/utils/url" export default async function IndexPageJsonLD({ @@ -17,72 +22,44 @@ export default async function IndexPageJsonLD({ const url = normalizeUrlForJsonLd(locale, `/`) - // JSON-LD structured data for the homepage - const webPageJsonLd = { + const jsonLd = { "@context": "https://schema.org", - "@type": "WebPage", - "@id": url, - name: t("page-index-meta-title"), - description: t("page-index-meta-description"), - url: url, - inLanguage: locale, - author: [ + "@graph": [ { - "@type": "Organization", + "@type": "WebSite", + "@id": "https://ethereum.org/#website", + url: url, name: "ethereum.org", - url: "https://ethereum.org", - }, - ], - isPartOf: { - "@type": "WebSite", - name: "ethereum.org", - url: "https://ethereum.org", - }, - breadcrumb: { - "@type": "BreadcrumbList", - itemListElement: [ - { - "@type": "ListItem", - position: 1, - name: "Home", - item: url, + description: t("page-index-meta-description"), + educationalUse: "Independent Study", + keywords: + "Ethereum, Blockchain, Smart Contracts, Web3, Open Source, Protocol, Documentation, Education", + inLanguage: locale, + license: "https://opensource.org/licenses/MIT", + audience: { + "@type": "EducationalAudience", + educationalRole: ["developer", "student"], + audienceType: "public", + }, + publisher: ethereumFoundationOrganization, + maintainer: ethereumFoundationReference, + contributor: ethereumCommunityOrganization, + about: { + "@type": "Thing", + name: "Ethereum", + description: + "A decentralized, open-source blockchain with smart contract functionality.", + image: "https://ethereum.org/images/assets/eth-diamond-glyph.png", + sameAs: [ + "https://www.wikidata.org/wiki/Q16783523", + "https://en.wikipedia.org/wiki/Ethereum", + "https://x.com/ethereum", + "https://github.com/ethereum", + ], }, - ], - }, - publisher: { - "@type": "Organization", - name: "ethereum.org", - url: "https://ethereum.org", - }, - reviewedBy: { - "@type": "Organization", - name: "ethereum.org", - url: "https://ethereum.org", - logo: { - "@type": "ImageObject", - url: "https://ethereum.org/images/eth-home-icon.png", }, - }, - } - // JSON-LD for ethereum.org as an organization - const organizationJsonLd = { - "@context": "https://schema.org", - "@type": "Organization", - "@id": "https://ethereum.org", - name: "ethereum.org", - url: "https://ethereum.org", - logo: "https://ethereum.org/images/eth-org-logo.png", - description: t("page-index-meta-description"), - sameAs: [ - "https://github.com/ethereum/ethereum-org-website", - "https://discord.gg/ethereum-org", - "https://x.com/EthDotOrg", ], - mainEntityOfPage: `https://ethereum.org`, - foundingDate: "2014", - slogan: - "Ethereum is the community-run technology powering the cryptocurrency ether and thousands of decentralized applications", } - return + return } diff --git a/app/[locale]/quizzes/page-jsonld.tsx b/app/[locale]/quizzes/page-jsonld.tsx index 308f644ed14..9e3ecbaed86 100644 --- a/app/[locale]/quizzes/page-jsonld.tsx +++ b/app/[locale]/quizzes/page-jsonld.tsx @@ -4,6 +4,10 @@ import { FileContributor, Lang } from "@/lib/types" import PageJsonLD from "@/components/PageJsonLD" +import { + ethereumCommunityOrganization, + ethereumFoundationOrganization, +} from "@/lib/utils/jsonld" import { normalizeUrlForJsonLd } from "@/lib/utils/url" export default async function QuizzesPageJsonLD({ @@ -25,55 +29,46 @@ export default async function QuizzesPageJsonLD({ url: contributor.html_url, })) - // JSON-LD structured data for the Quizzes page - const webPageJsonLd = { + const jsonLd = { "@context": "https://schema.org", - "@type": "WebPage", - "@id": url, - name: t("common:quizzes-title"), - description: t("quizzes-subtitle"), - url: url, - inLanguage: locale, - contributor: contributorList, - author: [ + "@graph": [ { - "@type": "Organization", - name: "ethereum.org", - url: "https://ethereum.org", - }, - ], - breadcrumb: { - "@type": "BreadcrumbList", - itemListElement: [ - { - "@type": "ListItem", - position: 1, - name: "Home", - item: normalizeUrlForJsonLd(locale, "/"), + "@type": "WebPage", + "@id": url, + name: t("common:quizzes-title"), + description: t("quizzes-subtitle"), + url: url, + inLanguage: locale, + contributor: contributorList, + author: [ethereumCommunityOrganization], + isPartOf: { + "@type": "WebSite", + "@id": "https://ethereum.org/#website", + name: "ethereum.org", + url: "https://ethereum.org", }, - { - "@type": "ListItem", - position: 2, - name: t("common:quizzes-title"), - item: url, + breadcrumb: { + "@type": "BreadcrumbList", + itemListElement: [ + { + "@type": "ListItem", + position: 1, + name: "Home", + item: normalizeUrlForJsonLd(locale, "/"), + }, + { + "@type": "ListItem", + position: 2, + name: t("common:quizzes-title"), + item: url, + }, + ], }, - ], - }, - publisher: { - "@type": "Organization", - name: "ethereum.org", - url: "https://ethereum.org", - }, - reviewedBy: { - "@type": "Organization", - name: "ethereum.org", - url: "https://ethereum.org", - logo: { - "@type": "ImageObject", - url: "https://ethereum.org/images/eth-home-icon.png", + publisher: ethereumFoundationOrganization, + reviewedBy: ethereumFoundationOrganization, }, - }, + ], } - return + return } diff --git a/app/[locale]/resources/page-jsonld.tsx b/app/[locale]/resources/page-jsonld.tsx index 35794ae91e0..a09884270cb 100644 --- a/app/[locale]/resources/page-jsonld.tsx +++ b/app/[locale]/resources/page-jsonld.tsx @@ -4,6 +4,10 @@ import { FileContributor, Lang } from "@/lib/types" import PageJsonLD from "@/components/PageJsonLD" +import { + ethereumCommunityOrganization, + ethereumFoundationOrganization, +} from "@/lib/utils/jsonld" import { normalizeUrlForJsonLd } from "@/lib/utils/url" export default async function ResourcesPageJsonLD({ @@ -25,55 +29,46 @@ export default async function ResourcesPageJsonLD({ url: contributor.html_url, })) - // JSON-LD structured data for the Resources page - const webPageJsonLd = { + const jsonLd = { "@context": "https://schema.org", - "@type": "WebPage", - "@id": url, - name: t("page-resources-meta-title"), - description: t("page-resources-meta-description"), - url: url, - inLanguage: locale, - contributor: contributorList, - author: [ + "@graph": [ { - "@type": "Organization", - name: "ethereum.org", - url: "https://ethereum.org", - }, - ], - breadcrumb: { - "@type": "BreadcrumbList", - itemListElement: [ - { - "@type": "ListItem", - position: 1, - name: "Home", - item: normalizeUrlForJsonLd(locale, "/"), + "@type": "WebPage", + "@id": url, + name: t("page-resources-meta-title"), + description: t("page-resources-meta-description"), + url: url, + inLanguage: locale, + contributor: contributorList, + author: [ethereumCommunityOrganization], + isPartOf: { + "@type": "WebSite", + "@id": "https://ethereum.org/#website", + name: "ethereum.org", + url: "https://ethereum.org", }, - { - "@type": "ListItem", - position: 2, - name: t("page-resources-meta-title"), - item: url, + breadcrumb: { + "@type": "BreadcrumbList", + itemListElement: [ + { + "@type": "ListItem", + position: 1, + name: "Home", + item: normalizeUrlForJsonLd(locale, "/"), + }, + { + "@type": "ListItem", + position: 2, + name: t("page-resources-meta-title"), + item: url, + }, + ], }, - ], - }, - publisher: { - "@type": "Organization", - name: "ethereum.org", - url: "https://ethereum.org", - }, - reviewedBy: { - "@type": "Organization", - name: "ethereum.org", - url: "https://ethereum.org", - logo: { - "@type": "ImageObject", - url: "https://ethereum.org/images/eth-home-icon.png", + publisher: ethereumFoundationOrganization, + reviewedBy: ethereumFoundationOrganization, }, - }, + ], } - return + return } diff --git a/app/[locale]/roadmap/_vision/page-jsonld.tsx b/app/[locale]/roadmap/_vision/page-jsonld.tsx index 9a1e8284776..cf4fe24614a 100644 --- a/app/[locale]/roadmap/_vision/page-jsonld.tsx +++ b/app/[locale]/roadmap/_vision/page-jsonld.tsx @@ -4,6 +4,10 @@ import { FileContributor, Lang } from "@/lib/types" import PageJsonLD from "@/components/PageJsonLD" +import { + ethereumCommunityOrganization, + ethereumFoundationOrganization, +} from "@/lib/utils/jsonld" import { normalizeUrlForJsonLd } from "@/lib/utils/url" export default async function RoadmapVisionPageJsonLD({ @@ -27,99 +31,71 @@ export default async function RoadmapVisionPageJsonLD({ url: contributor.html_url, })) - // JSON-LD structured data for the Vision page - const webPageJsonLd = { + const jsonLd = { "@context": "https://schema.org", - "@type": "WebPage", - "@id": url, - name: t("page-roadmap-vision-title"), - description: t("page-roadmap-vision-subtitle"), - url: url, - inLanguage: locale, - contributor: contributorList, - author: [ + "@graph": [ { - "@type": "Organization", - name: "ethereum.org", - url: "https://ethereum.org", - }, - ], - breadcrumb: { - "@type": "BreadcrumbList", - itemListElement: [ - { - "@type": "ListItem", - position: 1, - name: "Home", - item: normalizeUrlForJsonLd(locale, "/"), + "@type": "WebPage", + "@id": url, + name: t("page-roadmap-vision-title"), + description: t("page-roadmap-vision-subtitle"), + url: url, + inLanguage: locale, + contributor: contributorList, + author: [ethereumCommunityOrganization], + isPartOf: { + "@type": "WebSite", + "@id": "https://ethereum.org/#website", + name: "ethereum.org", + url: "https://ethereum.org", }, - { - "@type": "ListItem", - position: 2, - name: "Roadmap", - item: normalizeUrlForJsonLd(locale, "/roadmap/"), + breadcrumb: { + "@type": "BreadcrumbList", + itemListElement: [ + { + "@type": "ListItem", + position: 1, + name: "Home", + item: normalizeUrlForJsonLd(locale, "/"), + }, + { + "@type": "ListItem", + position: 2, + name: "Roadmap", + item: normalizeUrlForJsonLd(locale, "/roadmap/"), + }, + { + "@type": "ListItem", + position: 3, + name: t("page-roadmap-vision-title"), + item: url, + }, + ], }, - { - "@type": "ListItem", - position: 3, - name: t("page-roadmap-vision-title"), - item: url, - }, - ], - }, - publisher: { - "@type": "Organization", - name: "ethereum.org", - url: "https://ethereum.org", - }, - reviewedBy: { - "@type": "Organization", - name: "ethereum.org", - url: "https://ethereum.org", - logo: { - "@type": "ImageObject", - url: "https://ethereum.org/images/eth-home-icon.png", + publisher: ethereumFoundationOrganization, + reviewedBy: ethereumFoundationOrganization, + mainEntity: { "@id": `${url}#roadmap-vision` }, }, - }, - } - - // JSON-LD for the vision article content - const articleJsonLd = { - "@context": "https://schema.org", - "@type": "Article", - headline: t("page-roadmap-vision-title"), - description: t("page-roadmap-vision-subtitle"), - image: "https://ethereum.org/images/upgrades/oldship.png", - author: [ { - "@type": "Organization", - name: "ethereum.org", - url: "https://ethereum.org", + "@type": "Article", + "@id": `${url}#roadmap-vision`, + headline: t("page-roadmap-vision-title"), + description: t("page-roadmap-vision-subtitle"), + image: "https://ethereum.org/images/upgrades/oldship.png", + author: [ethereumCommunityOrganization], + publisher: ethereumFoundationOrganization, + contributor: contributorList, + reviewedBy: ethereumFoundationOrganization, + about: { + "@type": "Thing", + name: "Ethereum Vision", + description: + "The vision for Ethereum's future development and capabilities", + }, + dateModified: lastEditLocaleTimestamp, }, ], - publisher: { - "@type": "Organization", - name: "ethereum.org", - url: "https://ethereum.org", - }, - contributor: contributorList, - reviewedBy: { - "@type": "Organization", - name: "ethereum.org", - url: "https://ethereum.org", - logo: { - "@type": "ImageObject", - url: "https://ethereum.org/images/eth-home-icon.png", - }, - }, - about: { - "@type": "Thing", - name: "Ethereum Vision", - description: - "The vision for Ethereum's future development and capabilities", - }, - dateModified: lastEditLocaleTimestamp, } - return + return } diff --git a/app/[locale]/roadmap/page-jsonld.tsx b/app/[locale]/roadmap/page-jsonld.tsx index 9546d4712a5..3d04e7c8f0e 100644 --- a/app/[locale]/roadmap/page-jsonld.tsx +++ b/app/[locale]/roadmap/page-jsonld.tsx @@ -4,6 +4,10 @@ import { FileContributor, Lang } from "@/lib/types" import PageJsonLD from "@/components/PageJsonLD" +import { + ethereumCommunityOrganization, + ethereumFoundationOrganization, +} from "@/lib/utils/jsonld" import { normalizeUrlForJsonLd } from "@/lib/utils/url" export default async function RoadmapPageJsonLD({ @@ -25,140 +29,108 @@ export default async function RoadmapPageJsonLD({ url: contributor.html_url, })) - // JSON-LD structured data for the Roadmap page - const webPageJsonLd = { + const jsonLd = { "@context": "https://schema.org", - "@type": "WebPage", - "@id": url, - name: t("page-roadmap-meta-title"), - description: t("page-roadmap-meta-description"), - url: url, - inLanguage: locale, - contributor: contributorList, - author: [ + "@graph": [ { - "@type": "Organization", - name: "ethereum.org", - url: "https://ethereum.org", - }, - ], - breadcrumb: { - "@type": "BreadcrumbList", - itemListElement: [ - { - "@type": "ListItem", - position: 1, - name: "Home", - item: normalizeUrlForJsonLd(locale, "/"), + "@type": "WebPage", + "@id": url, + name: t("page-roadmap-meta-title"), + description: t("page-roadmap-meta-description"), + url: url, + inLanguage: locale, + contributor: contributorList, + author: [ethereumCommunityOrganization], + isPartOf: { + "@type": "WebSite", + "@id": "https://ethereum.org/#website", + name: "ethereum.org", + url: "https://ethereum.org", }, - { - "@type": "ListItem", - position: 2, - name: t("page-roadmap-meta-title"), - item: url, + breadcrumb: { + "@type": "BreadcrumbList", + itemListElement: [ + { + "@type": "ListItem", + position: 1, + name: "Home", + item: normalizeUrlForJsonLd(locale, "/"), + }, + { + "@type": "ListItem", + position: 2, + name: t("page-roadmap-meta-title"), + item: url, + }, + ], }, - ], - }, - publisher: { - "@type": "Organization", - name: "ethereum.org", - url: "https://ethereum.org", - }, - reviewedBy: { - "@type": "Organization", - name: "ethereum.org", - url: "https://ethereum.org", - logo: { - "@type": "ImageObject", - url: "https://ethereum.org/images/eth-home-icon.png", + publisher: ethereumFoundationOrganization, + reviewedBy: ethereumFoundationOrganization, + mainEntity: { "@id": `${url}#roadmap` }, }, - }, - } - - // JSON-LD for the roadmap article content - const articleJsonLd = { - "@context": "https://schema.org", - "@type": "Article", - headline: t("page-roadmap-title"), - description: t("page-roadmap-meta-description"), - image: "https://ethereum.org/images/heroes/roadmap-hub-hero.jpg", - author: [ { - "@type": "Organization", - name: "ethereum.org", - url: "https://ethereum.org", - }, - ], - publisher: { - "@type": "Organization", - name: "ethereum.org", - url: "https://ethereum.org", - }, - contributor: contributorList, - reviewedBy: { - "@type": "Organization", - name: "ethereum.org", - url: "https://ethereum.org", - logo: { - "@type": "ImageObject", - url: "https://ethereum.org/images/eth-home-icon.png", - }, - }, - about: { - "@type": "Thing", - name: "Ethereum Roadmap", - description: - "The future development and upgrade path of the Ethereum blockchain", - }, - } - - // JSON-LD for the FAQ section - const faqJsonLd = { - "@context": "https://schema.org", - "@type": "FAQPage", - mainEntity: [ - { - "@type": "Question", - name: t("page-roadmap-faq-1-title"), - acceptedAnswer: { - "@type": "Answer", - text: `${t("page-roadmap-faq-1-p1")} ${t("page-roadmap-faq-1-p1-continued")} ${t("page-roadmap-faq-1-p2")}`.replace( - /<[^>]*>/g, - "" - ), - }, - }, - { - "@type": "Question", - name: t("page-roadmap-faq-2-title"), - acceptedAnswer: { - "@type": "Answer", - text: `${t("page-roadmap-faq-2-p1")} ${t("page-roadmap-faq-2-p1-strong")} ${t("page-roadmap-faq-2-p1-continued")} ${t("page-roadmap-faq-2-p2")}`.replace( - /<[^>]*>/g, - "" - ), + "@type": "Article", + "@id": `${url}#roadmap`, + headline: t("page-roadmap-title"), + description: t("page-roadmap-meta-description"), + image: "https://ethereum.org/images/heroes/roadmap-hub-hero.jpg", + author: [ethereumCommunityOrganization], + publisher: ethereumFoundationOrganization, + contributor: contributorList, + reviewedBy: ethereumFoundationOrganization, + about: { + "@type": "Thing", + name: "Ethereum Roadmap", + description: + "The future development and upgrade path of the Ethereum blockchain", }, }, { - "@type": "Question", - name: t("page-roadmap-faq-3-title"), - acceptedAnswer: { - "@type": "Answer", - text: t("page-roadmap-faq-3-p1").replace(/<[^>]*>/g, ""), - }, - }, - { - "@type": "Question", - name: t("page-roadmap-faq-4-title"), - acceptedAnswer: { - "@type": "Answer", - text: t("page-roadmap-faq-4-p1").replace(/<[^>]*>/g, ""), - }, + "@type": "FAQPage", + "@id": `${url}#roadmap-faq`, + mainEntity: [ + { + "@type": "Question", + name: t("page-roadmap-faq-1-title"), + acceptedAnswer: { + "@type": "Answer", + text: `${t("page-roadmap-faq-1-p1")} ${t("page-roadmap-faq-1-p1-continued")} ${t("page-roadmap-faq-1-p2")}`.replace( + /<[^>]*>/g, + "" + ), + }, + }, + { + "@type": "Question", + name: t("page-roadmap-faq-2-title"), + acceptedAnswer: { + "@type": "Answer", + text: `${t("page-roadmap-faq-2-p1")} ${t("page-roadmap-faq-2-p1-strong")} ${t("page-roadmap-faq-2-p1-continued")} ${t("page-roadmap-faq-2-p2")}`.replace( + /<[^>]*>/g, + "" + ), + }, + }, + { + "@type": "Question", + name: t("page-roadmap-faq-3-title"), + acceptedAnswer: { + "@type": "Answer", + text: t("page-roadmap-faq-3-p1").replace(/<[^>]*>/g, ""), + }, + }, + { + "@type": "Question", + name: t("page-roadmap-faq-4-title"), + acceptedAnswer: { + "@type": "Answer", + text: t("page-roadmap-faq-4-p1").replace(/<[^>]*>/g, ""), + }, + }, + ], }, ], } - return ( - - ) + return } diff --git a/app/[locale]/run-a-node/page-jsonld.tsx b/app/[locale]/run-a-node/page-jsonld.tsx index 2385e13360c..78ceb3d272a 100644 --- a/app/[locale]/run-a-node/page-jsonld.tsx +++ b/app/[locale]/run-a-node/page-jsonld.tsx @@ -4,6 +4,10 @@ import { FileContributor, Lang } from "@/lib/types" import PageJsonLD from "@/components/PageJsonLD" +import { + ethereumCommunityOrganization, + ethereumFoundationOrganization, +} from "@/lib/utils/jsonld" import { normalizeUrlForJsonLd } from "@/lib/utils/url" export default async function RunANodePageJsonLD({ @@ -27,93 +31,65 @@ export default async function RunANodePageJsonLD({ url: contributor.html_url, })) - // JSON-LD structured data for the Run a Node page - const webPageJsonLd = { + const jsonLd = { "@context": "https://schema.org", - "@type": "WebPage", - "@id": url, - name: t("page-run-a-node-title"), - description: t("page-run-a-node-hero-subtitle"), - url: url, - inLanguage: locale, - contributor: contributorList, - author: [ + "@graph": [ { - "@type": "Organization", - name: "ethereum.org", - url: "https://ethereum.org", - }, - ], - breadcrumb: { - "@type": "BreadcrumbList", - itemListElement: [ - { - "@type": "ListItem", - position: 1, - name: "Home", - item: normalizeUrlForJsonLd(locale, "/"), + "@type": "WebPage", + "@id": url, + name: t("page-run-a-node-title"), + description: t("page-run-a-node-hero-subtitle"), + url: url, + inLanguage: locale, + contributor: contributorList, + author: [ethereumCommunityOrganization], + isPartOf: { + "@type": "WebSite", + "@id": "https://ethereum.org/#website", + name: "ethereum.org", + url: "https://ethereum.org", }, - { - "@type": "ListItem", - position: 2, - name: t("page-run-a-node-title"), - item: url, + breadcrumb: { + "@type": "BreadcrumbList", + itemListElement: [ + { + "@type": "ListItem", + position: 1, + name: "Home", + item: normalizeUrlForJsonLd(locale, "/"), + }, + { + "@type": "ListItem", + position: 2, + name: t("page-run-a-node-title"), + item: url, + }, + ], }, - ], - }, - publisher: { - "@type": "Organization", - name: "ethereum.org", - url: "https://ethereum.org", - }, - reviewedBy: { - "@type": "Organization", - name: "ethereum.org", - url: "https://ethereum.org", - logo: { - "@type": "ImageObject", - url: "https://ethereum.org/images/eth-home-icon.png", + publisher: ethereumFoundationOrganization, + reviewedBy: ethereumFoundationOrganization, + mainEntity: { "@id": `${url}#run-a-node` }, }, - }, - } - - // JSON-LD for the run a node article content - const articleJsonLd = { - "@context": "https://schema.org", - "@type": "Article", - headline: t("page-run-a-node-title"), - description: t("page-run-a-node-hero-subtitle"), - image: "https://ethereum.org/images/run-a-node/ethereum-inside.png", - author: [ { - "@type": "Organization", - name: "ethereum.org", - url: "https://ethereum.org", + "@type": "Article", + "@id": `${url}#run-a-node`, + headline: t("page-run-a-node-title"), + description: t("page-run-a-node-hero-subtitle"), + image: "https://ethereum.org/images/run-a-node/ethereum-inside.png", + author: [ethereumCommunityOrganization], + contributor: contributorList, + publisher: ethereumFoundationOrganization, + reviewedBy: ethereumFoundationOrganization, + about: { + "@type": "Thing", + name: "Running an Ethereum Node", + description: + "Guide to running your own Ethereum node, benefits, and requirements", + }, + dateModified: lastEditLocaleTimestamp, }, ], - contributor: contributorList, - publisher: { - "@type": "Organization", - name: "ethereum.org", - url: "https://ethereum.org", - }, - reviewedBy: { - "@type": "Organization", - name: "ethereum.org", - url: "https://ethereum.org", - logo: { - "@type": "ImageObject", - url: "https://ethereum.org/images/eth-home-icon.png", - }, - }, - about: { - "@type": "Thing", - name: "Running an Ethereum Node", - description: - "Guide to running your own Ethereum node, benefits, and requirements", - }, - dateModified: lastEditLocaleTimestamp, } - return + return } diff --git a/app/[locale]/stablecoins/page-jsonld.tsx b/app/[locale]/stablecoins/page-jsonld.tsx index d6ae3c01c2d..b3b6948fbe6 100644 --- a/app/[locale]/stablecoins/page-jsonld.tsx +++ b/app/[locale]/stablecoins/page-jsonld.tsx @@ -2,6 +2,10 @@ import { getTranslations } from "next-intl/server" import PageJsonLD from "@/components/PageJsonLD" +import { + ethereumCommunityOrganization, + ethereumFoundationOrganization, +} from "@/lib/utils/jsonld" import { normalizeUrlForJsonLd } from "@/lib/utils/url" export default async function StablecoinsPageJsonLD({ locale, contributors }) { @@ -17,92 +21,64 @@ export default async function StablecoinsPageJsonLD({ locale, contributors }) { url: contributor.html_url, })) - // JSON-LD structured data for the Stablecoins page - const webPageJsonLd = { + const jsonLd = { "@context": "https://schema.org", - "@type": "WebPage", - "@id": url, - name: t("page-stablecoins-meta-title"), - description: t("page-stablecoins-meta-description"), - url: url, - inLanguage: locale, - contributor: contributorList, - author: [ + "@graph": [ { - "@type": "Organization", - name: "ethereum.org", - url: "https://ethereum.org", - }, - ], - breadcrumb: { - "@type": "BreadcrumbList", - itemListElement: [ - { - "@type": "ListItem", - position: 1, - name: "Home", - item: normalizeUrlForJsonLd(locale, "/"), + "@type": "WebPage", + "@id": url, + name: t("page-stablecoins-meta-title"), + description: t("page-stablecoins-meta-description"), + url: url, + inLanguage: locale, + contributor: contributorList, + author: [ethereumCommunityOrganization], + isPartOf: { + "@type": "WebSite", + "@id": "https://ethereum.org/#website", + name: "ethereum.org", + url: "https://ethereum.org", }, - { - "@type": "ListItem", - position: 2, - name: t("page-stablecoins-meta-title"), - item: url, + breadcrumb: { + "@type": "BreadcrumbList", + itemListElement: [ + { + "@type": "ListItem", + position: 1, + name: "Home", + item: normalizeUrlForJsonLd(locale, "/"), + }, + { + "@type": "ListItem", + position: 2, + name: t("page-stablecoins-meta-title"), + item: url, + }, + ], }, - ], - }, - publisher: { - "@type": "Organization", - name: "ethereum.org", - url: "https://ethereum.org", - }, - reviewedBy: { - "@type": "Organization", - name: "ethereum.org", - url: "https://ethereum.org", - logo: { - "@type": "ImageObject", - url: "https://ethereum.org/images/eth-home-icon.png", + publisher: ethereumFoundationOrganization, + reviewedBy: ethereumFoundationOrganization, + mainEntity: { "@id": `${url}#stablecoins` }, }, - }, - } - - // JSON-LD for the stablecoins article content - const articleJsonLd = { - "@context": "https://schema.org", - "@type": "Article", - headline: t("page-stablecoins-title"), - description: t("page-stablecoins-meta-description"), - image: "https://ethereum.org/images/stablecoins/hero.png", - author: [ { - "@type": "Organization", - name: "ethereum.org", - url: "https://ethereum.org", + "@type": "Article", + "@id": `${url}#stablecoins`, + headline: t("page-stablecoins-title"), + description: t("page-stablecoins-meta-description"), + image: "https://ethereum.org/images/stablecoins/hero.png", + author: [ethereumCommunityOrganization], + contributor: contributorList, + publisher: ethereumFoundationOrganization, + reviewedBy: ethereumFoundationOrganization, + about: { + "@type": "Thing", + name: "Stablecoins", + description: + "Digital currencies pegged to stable assets like the US dollar", + }, }, ], - contributor: contributorList, - publisher: { - "@type": "Organization", - name: "ethereum.org", - url: "https://ethereum.org", - }, - reviewedBy: { - "@type": "Organization", - name: "ethereum.org", - url: "https://ethereum.org", - logo: { - "@type": "ImageObject", - url: "https://ethereum.org/images/eth-home-icon.png", - }, - }, - about: { - "@type": "Thing", - name: "Stablecoins", - description: - "Digital currencies pegged to stable assets like the US dollar", - }, } - return + return } diff --git a/app/[locale]/staking/page-jsonld.tsx b/app/[locale]/staking/page-jsonld.tsx index 37bb723e903..5d20ff21f7d 100644 --- a/app/[locale]/staking/page-jsonld.tsx +++ b/app/[locale]/staking/page-jsonld.tsx @@ -4,6 +4,10 @@ import { FileContributor, Lang } from "@/lib/types" import PageJsonLD from "@/components/PageJsonLD" +import { + ethereumCommunityOrganization, + ethereumFoundationOrganization, +} from "@/lib/utils/jsonld" import { normalizeUrlForJsonLd } from "@/lib/utils/url" export default async function StakingPageJsonLD({ @@ -27,152 +31,120 @@ export default async function StakingPageJsonLD({ url: contributor.html_url, })) - // JSON-LD structured data for the Staking page - const webPageJsonLd = { + const jsonLd = { "@context": "https://schema.org", - "@type": "WebPage", - "@id": url, - name: t("page-staking-meta-title"), - description: t("page-staking-meta-description"), - url: url, - inLanguage: locale, - contributor: contributorList, - author: [ + "@graph": [ { - "@type": "Organization", - name: "ethereum.org", - url: "https://ethereum.org", - }, - ], - breadcrumb: { - "@type": "BreadcrumbList", - itemListElement: [ - { - "@type": "ListItem", - position: 1, - name: "Home", - item: normalizeUrlForJsonLd(locale, "/"), - }, - { - "@type": "ListItem", - position: 2, - name: t("page-staking-meta-title"), - item: url, - }, - ], - }, - publisher: { - "@type": "Organization", - name: "ethereum.org", - url: "https://ethereum.org", - }, - reviewedBy: { - "@type": "Organization", - name: "ethereum.org", - url: "https://ethereum.org", - logo: { - "@type": "ImageObject", - url: "https://ethereum.org/images/eth-home-icon.png", - }, - }, - } - - // JSON-LD for the staking article content - const articleJsonLd = { - "@context": "https://schema.org", - "@type": "Article", - headline: t("page-staking-hero-title"), - description: t("page-staking-meta-description"), - image: "https://ethereum.org/images/upgrades/upgrade_rhino.png", - author: [ - { - "@type": "Organization", - name: "ethereum.org", - url: "https://ethereum.org", - }, - ], - contributor: contributorList, - publisher: { - "@type": "Organization", - name: "ethereum.org", - url: "https://ethereum.org", - }, - reviewedBy: { - "@type": "Organization", - name: "ethereum.org", - url: "https://ethereum.org", - logo: { - "@type": "ImageObject", - url: "https://ethereum.org/images/eth-home-icon.png", - }, - }, - about: { - "@type": "Thing", - name: "Ethereum Staking", - description: - "Guide to staking ETH, earning rewards, and securing the Ethereum network", - }, - dateModified: lastEditLocaleTimestamp, - } - - // JSON-LD for the FAQ section - const faqJsonLd = { - "@context": "https://schema.org", - "@type": "FAQPage", - mainEntity: [ - { - "@type": "Question", - name: t("page-staking-faq-4-question"), - acceptedAnswer: { - "@type": "Answer", - text: `${t("page-staking-faq-4-answer-p1")} ${t("page-staking-faq-4-answer-p2")} ${t("page-staking-faq-4-answer-p3")}`.replace( - /<[^>]*>/g, - "" - ), + "@type": "WebPage", + "@id": url, + name: t("page-staking-meta-title"), + description: t("page-staking-meta-description"), + url: url, + inLanguage: locale, + contributor: contributorList, + author: [ethereumCommunityOrganization], + isPartOf: { + "@type": "WebSite", + "@id": "https://ethereum.org/#website", + name: "ethereum.org", + url: "https://ethereum.org", }, - }, - { - "@type": "Question", - name: t("page-staking-faq-5-question"), - acceptedAnswer: { - "@type": "Answer", - text: `${t("page-staking-faq-5-answer-p1")} ${t("page-staking-faq-5-answer-p2")}`.replace( - /<[^>]*>/g, - "" - ), + breadcrumb: { + "@type": "BreadcrumbList", + itemListElement: [ + { + "@type": "ListItem", + position: 1, + name: "Home", + item: normalizeUrlForJsonLd(locale, "/"), + }, + { + "@type": "ListItem", + position: 2, + name: t("page-staking-meta-title"), + item: url, + }, + ], }, + publisher: ethereumFoundationOrganization, + reviewedBy: ethereumFoundationOrganization, + mainEntity: { "@id": `${url}#staking` }, }, { - "@type": "Question", - name: t("page-staking-faq-1-question"), - acceptedAnswer: { - "@type": "Answer", - text: t("page-staking-faq-1-answer").replace(/<[^>]*>/g, ""), + "@type": "Article", + "@id": `${url}#staking`, + headline: t("page-staking-hero-title"), + description: t("page-staking-meta-description"), + image: "https://ethereum.org/images/upgrades/upgrade_rhino.png", + author: [ethereumCommunityOrganization], + contributor: contributorList, + publisher: ethereumFoundationOrganization, + reviewedBy: ethereumFoundationOrganization, + about: { + "@type": "Thing", + name: "Ethereum Staking", + description: + "Guide to staking ETH, earning rewards, and securing the Ethereum network", }, + dateModified: lastEditLocaleTimestamp, }, { - "@type": "Question", - name: t("page-staking-faq-2-question"), - acceptedAnswer: { - "@type": "Answer", - text: t("page-staking-faq-2-answer").replace(/<[^>]*>/g, ""), - }, - }, - { - "@type": "Question", - name: t("page-staking-faq-3-question"), - acceptedAnswer: { - "@type": "Answer", - text: `${t("page-staking-faq-3-answer-p1")} ${t("page-staking-faq-3-answer-p2")}`.replace( - /<[^>]*>/g, - "" - ), - }, + "@type": "FAQPage", + "@id": `${url}#staking-faq`, + mainEntity: [ + { + "@type": "Question", + name: t("page-staking-faq-4-question"), + acceptedAnswer: { + "@type": "Answer", + text: `${t("page-staking-faq-4-answer-p1")} ${t("page-staking-faq-4-answer-p2")} ${t("page-staking-faq-4-answer-p3")}`.replace( + /<[^>]*>/g, + "" + ), + }, + }, + { + "@type": "Question", + name: t("page-staking-faq-5-question"), + acceptedAnswer: { + "@type": "Answer", + text: `${t("page-staking-faq-5-answer-p1")} ${t("page-staking-faq-5-answer-p2")}`.replace( + /<[^>]*>/g, + "" + ), + }, + }, + { + "@type": "Question", + name: t("page-staking-faq-1-question"), + acceptedAnswer: { + "@type": "Answer", + text: t("page-staking-faq-1-answer").replace(/<[^>]*>/g, ""), + }, + }, + { + "@type": "Question", + name: t("page-staking-faq-2-question"), + acceptedAnswer: { + "@type": "Answer", + text: t("page-staking-faq-2-answer").replace(/<[^>]*>/g, ""), + }, + }, + { + "@type": "Question", + name: t("page-staking-faq-3-question"), + acceptedAnswer: { + "@type": "Answer", + text: `${t("page-staking-faq-3-answer-p1")} ${t("page-staking-faq-3-answer-p2")}`.replace( + /<[^>]*>/g, + "" + ), + }, + }, + ], }, ], } - return ( - - ) + return } diff --git a/app/[locale]/start/page-jsonld.tsx b/app/[locale]/start/page-jsonld.tsx index 5a86a796cc6..ea822c1a631 100644 --- a/app/[locale]/start/page-jsonld.tsx +++ b/app/[locale]/start/page-jsonld.tsx @@ -4,6 +4,10 @@ import { FileContributor, Lang } from "@/lib/types" import PageJsonLD from "@/components/PageJsonLD" +import { + ethereumCommunityOrganization, + ethereumFoundationOrganization, +} from "@/lib/utils/jsonld" import { normalizeUrlForJsonLd } from "@/lib/utils/url" export default async function StartPageJsonLD({ @@ -25,92 +29,64 @@ export default async function StartPageJsonLD({ url: contributor.html_url, })) - // JSON-LD structured data for the Start page - const webPageJsonLd = { + const jsonLd = { "@context": "https://schema.org", - "@type": "WebPage", - "@id": url, - name: t("page-start-meta-title"), - description: t("page-start-meta-description"), - url: url, - inLanguage: locale, - contributor: contributorList, - author: [ + "@graph": [ { - "@type": "Organization", - name: "ethereum.org", - url: "https://ethereum.org", - }, - ], - breadcrumb: { - "@type": "BreadcrumbList", - itemListElement: [ - { - "@type": "ListItem", - position: 1, - name: "Home", - item: normalizeUrlForJsonLd(locale, "/"), + "@type": "WebPage", + "@id": url, + name: t("page-start-meta-title"), + description: t("page-start-meta-description"), + url: url, + inLanguage: locale, + contributor: contributorList, + author: [ethereumCommunityOrganization], + isPartOf: { + "@type": "WebSite", + "@id": "https://ethereum.org/#website", + name: "ethereum.org", + url: "https://ethereum.org", }, - { - "@type": "ListItem", - position: 2, - name: t("page-start-meta-title"), - item: url, + breadcrumb: { + "@type": "BreadcrumbList", + itemListElement: [ + { + "@type": "ListItem", + position: 1, + name: "Home", + item: normalizeUrlForJsonLd(locale, "/"), + }, + { + "@type": "ListItem", + position: 2, + name: t("page-start-meta-title"), + item: url, + }, + ], }, - ], - }, - publisher: { - "@type": "Organization", - name: "ethereum.org", - url: "https://ethereum.org", - }, - reviewedBy: { - "@type": "Organization", - name: "ethereum.org", - url: "https://ethereum.org", - logo: { - "@type": "ImageObject", - url: "https://ethereum.org/images/eth-home-icon.png", + publisher: ethereumFoundationOrganization, + reviewedBy: ethereumFoundationOrganization, + mainEntity: { "@id": `${url}#start` }, }, - }, - } - - // JSON-LD for the start guide article content - const articleJsonLd = { - "@context": "https://schema.org", - "@type": "Article", - headline: t("page-start-title"), - description: t("page-start-meta-description"), - image: "https://ethereum.org/images/heroes/developers-hub-hero.jpg", - author: [ { - "@type": "Organization", - name: "ethereum.org", - url: "https://ethereum.org", + "@type": "Article", + "@id": `${url}#start`, + headline: t("page-start-title"), + description: t("page-start-meta-description"), + image: "https://ethereum.org/images/heroes/developers-hub-hero.jpg", + author: [ethereumCommunityOrganization], + publisher: ethereumFoundationOrganization, + contributor: contributorList, + reviewedBy: ethereumFoundationOrganization, + about: { + "@type": "Thing", + name: "Getting Started with Ethereum", + description: + "Beginner's guide to getting started with Ethereum, crypto wallets, and web3", + }, }, ], - publisher: { - "@type": "Organization", - name: "ethereum.org", - url: "https://ethereum.org", - }, - contributor: contributorList, - reviewedBy: { - "@type": "Organization", - name: "ethereum.org", - url: "https://ethereum.org", - logo: { - "@type": "ImageObject", - url: "https://ethereum.org/images/eth-home-icon.png", - }, - }, - about: { - "@type": "Thing", - name: "Getting Started with Ethereum", - description: - "Beginner's guide to getting started with Ethereum, crypto wallets, and web3", - }, } - return + return } diff --git a/app/[locale]/trillion-dollar-security/page-jsonld.tsx b/app/[locale]/trillion-dollar-security/page-jsonld.tsx index 2dafb0560ed..5ed2eb7434a 100644 --- a/app/[locale]/trillion-dollar-security/page-jsonld.tsx +++ b/app/[locale]/trillion-dollar-security/page-jsonld.tsx @@ -4,6 +4,10 @@ import { FileContributor, Lang } from "@/lib/types" import PageJsonLD from "@/components/PageJsonLD" +import { + ethereumCommunityOrganization, + ethereumFoundationOrganization, +} from "@/lib/utils/jsonld" import { normalizeUrlForJsonLd } from "@/lib/utils/url" export default async function TrillionDollarSecurityPageJsonLD({ @@ -25,92 +29,64 @@ export default async function TrillionDollarSecurityPageJsonLD({ url: contributor.html_url, })) - // JSON-LD structured data for the Trillion-Dollar Security page - const webPageJsonLd = { + const jsonLd = { "@context": "https://schema.org", - "@type": "WebPage", - "@id": url, - name: t("page-trillion-dollar-security-meta-title"), - description: t("page-trillion-dollar-security-meta-description"), - url: url, - inLanguage: locale, - contributor: contributorList, - author: [ + "@graph": [ { - "@type": "Organization", - name: "ethereum.org", - url: "https://ethereum.org", - }, - ], - breadcrumb: { - "@type": "BreadcrumbList", - itemListElement: [ - { - "@type": "ListItem", - position: 1, - name: "Home", - item: normalizeUrlForJsonLd(locale, "/"), + "@type": "WebPage", + "@id": url, + name: t("page-trillion-dollar-security-meta-title"), + description: t("page-trillion-dollar-security-meta-description"), + url: url, + inLanguage: locale, + contributor: contributorList, + author: [ethereumCommunityOrganization], + isPartOf: { + "@type": "WebSite", + "@id": "https://ethereum.org/#website", + name: "ethereum.org", + url: "https://ethereum.org", }, - { - "@type": "ListItem", - position: 2, - name: t("page-trillion-dollar-security-meta-title"), - item: url, + breadcrumb: { + "@type": "BreadcrumbList", + itemListElement: [ + { + "@type": "ListItem", + position: 1, + name: "Home", + item: normalizeUrlForJsonLd(locale, "/"), + }, + { + "@type": "ListItem", + position: 2, + name: t("page-trillion-dollar-security-meta-title"), + item: url, + }, + ], }, - ], - }, - publisher: { - "@type": "Organization", - name: "ethereum.org", - url: "https://ethereum.org", - }, - reviewedBy: { - "@type": "Organization", - name: "ethereum.org", - url: "https://ethereum.org", - logo: { - "@type": "ImageObject", - url: "https://ethereum.org/images/eth-home-icon.png", + publisher: ethereumFoundationOrganization, + reviewedBy: ethereumFoundationOrganization, + mainEntity: { "@id": `${url}#trillion-dollar-security` }, }, - }, - } - - // JSON-LD for the security report article content - const articleJsonLd = { - "@context": "https://schema.org", - "@type": "Article", - headline: t("page-trillion-dollar-security-title"), - description: t("page-trillion-dollar-security-meta-description"), - image: "https://ethereum.org/images/trillion-dollar-security/hero.png", - author: [ { - "@type": "Organization", - name: "ethereum.org", - url: "https://ethereum.org", + "@type": "Article", + "@id": `${url}#trillion-dollar-security`, + headline: t("page-trillion-dollar-security-title"), + description: t("page-trillion-dollar-security-meta-description"), + image: "https://ethereum.org/images/trillion-dollar-security/hero.png", + author: [ethereumCommunityOrganization], + contributor: contributorList, + publisher: ethereumFoundationOrganization, + reviewedBy: ethereumFoundationOrganization, + about: { + "@type": "Thing", + name: "Ethereum Security", + description: + "Comprehensive security analysis of Ethereum's trillion-dollar ecosystem", + }, }, ], - contributor: contributorList, - publisher: { - "@type": "Organization", - name: "ethereum.org", - url: "https://ethereum.org", - }, - reviewedBy: { - "@type": "Organization", - name: "ethereum.org", - url: "https://ethereum.org", - logo: { - "@type": "ImageObject", - url: "https://ethereum.org/images/eth-home-icon.png", - }, - }, - about: { - "@type": "Thing", - name: "Ethereum Security", - description: - "Comprehensive security analysis of Ethereum's trillion-dollar ecosystem", - }, } - return + return } diff --git a/app/[locale]/wallets/find-wallet/page-jsonld.tsx b/app/[locale]/wallets/find-wallet/page-jsonld.tsx index 38520ed0819..1bfbdcd7be0 100644 --- a/app/[locale]/wallets/find-wallet/page-jsonld.tsx +++ b/app/[locale]/wallets/find-wallet/page-jsonld.tsx @@ -4,6 +4,10 @@ import { FileContributor, Lang } from "@/lib/types" import PageJsonLD from "@/components/PageJsonLD" +import { + ethereumCommunityOrganization, + ethereumFoundationOrganization, +} from "@/lib/utils/jsonld" import { normalizeUrlForJsonLd } from "@/lib/utils/url" export default async function FindWalletPageJsonLD({ @@ -25,98 +29,70 @@ export default async function FindWalletPageJsonLD({ url: contributor.html_url, })) - // JSON-LD structured data for the Find Wallet page - const webPageJsonLd = { + const jsonLd = { "@context": "https://schema.org", - "@type": "WebPage", - "@id": url, - name: t("page-find-wallet-meta-title"), - description: t("page-find-wallet-meta-description"), - url: url, - inLanguage: locale, - contributor: contributorList, - author: [ + "@graph": [ { - "@type": "Organization", - name: "ethereum.org", - url: "https://ethereum.org", - }, - ], - breadcrumb: { - "@type": "BreadcrumbList", - itemListElement: [ - { - "@type": "ListItem", - position: 1, - name: "Home", - item: normalizeUrlForJsonLd(locale, "/"), + "@type": "WebPage", + "@id": url, + name: t("page-find-wallet-meta-title"), + description: t("page-find-wallet-meta-description"), + url: url, + inLanguage: locale, + contributor: contributorList, + author: [ethereumCommunityOrganization], + isPartOf: { + "@type": "WebSite", + "@id": "https://ethereum.org/#website", + name: "ethereum.org", + url: "https://ethereum.org", }, - { - "@type": "ListItem", - position: 2, - name: "Wallets", - item: normalizeUrlForJsonLd(locale, "/wallets/"), + breadcrumb: { + "@type": "BreadcrumbList", + itemListElement: [ + { + "@type": "ListItem", + position: 1, + name: "Home", + item: normalizeUrlForJsonLd(locale, "/"), + }, + { + "@type": "ListItem", + position: 2, + name: "Wallets", + item: normalizeUrlForJsonLd(locale, "/wallets/"), + }, + { + "@type": "ListItem", + position: 3, + name: t("page-find-wallet-meta-title"), + item: url, + }, + ], }, - { - "@type": "ListItem", - position: 3, - name: t("page-find-wallet-meta-title"), - item: url, - }, - ], - }, - publisher: { - "@type": "Organization", - name: "ethereum.org", - url: "https://ethereum.org", - }, - reviewedBy: { - "@type": "Organization", - name: "ethereum.org", - url: "https://ethereum.org", - logo: { - "@type": "ImageObject", - url: "https://ethereum.org/images/eth-home-icon.png", + publisher: ethereumFoundationOrganization, + reviewedBy: ethereumFoundationOrganization, + mainEntity: { "@id": `${url}#find-wallet` }, }, - }, - } - - // JSON-LD for the wallet finder article content - const articleJsonLd = { - "@context": "https://schema.org", - "@type": "Article", - headline: t("page-find-wallet-title"), - description: t("page-find-wallet-meta-description"), - image: "https://ethereum.org/images/wallets/wallet-hero.png", - author: [ { - "@type": "Organization", - name: "ethereum.org", - url: "https://ethereum.org", + "@type": "Article", + "@id": `${url}#find-wallet`, + headline: t("page-find-wallet-title"), + description: t("page-find-wallet-meta-description"), + image: "https://ethereum.org/images/wallets/wallet-hero.png", + author: [ethereumCommunityOrganization], + publisher: ethereumFoundationOrganization, + contributor: contributorList, + reviewedBy: ethereumFoundationOrganization, + about: { + "@type": "Thing", + name: "Ethereum Wallet Finder", + description: + "Tool to find and compare Ethereum wallets based on features and requirements", + }, }, ], - publisher: { - "@type": "Organization", - name: "ethereum.org", - url: "https://ethereum.org", - }, - contributor: contributorList, - reviewedBy: { - "@type": "Organization", - name: "ethereum.org", - url: "https://ethereum.org", - logo: { - "@type": "ImageObject", - url: "https://ethereum.org/images/eth-home-icon.png", - }, - }, - about: { - "@type": "Thing", - name: "Ethereum Wallet Finder", - description: - "Tool to find and compare Ethereum wallets based on features and requirements", - }, } - return + return } diff --git a/app/[locale]/wallets/page-jsonld.tsx b/app/[locale]/wallets/page-jsonld.tsx index c29fb7f818f..fc4c1f50ff4 100644 --- a/app/[locale]/wallets/page-jsonld.tsx +++ b/app/[locale]/wallets/page-jsonld.tsx @@ -2,6 +2,10 @@ import { getTranslations } from "next-intl/server" import PageJsonLD from "@/components/PageJsonLD" +import { + ethereumCommunityOrganization, + ethereumFoundationOrganization, +} from "@/lib/utils/jsonld" import { normalizeUrlForJsonLd } from "@/lib/utils/url" export default async function WalletsPageJsonLD({ @@ -21,93 +25,65 @@ export default async function WalletsPageJsonLD({ url: contributor.html_url, })) - // JSON-LD structured data for the Wallets page - const webPageJsonLd = { + const jsonLd = { "@context": "https://schema.org", - "@type": "WebPage", - "@id": url, - name: t("page-wallets-meta-title"), - description: t("page-wallets-meta-description"), - url: url, - inLanguage: locale, - contributor: contributorList, - author: [ + "@graph": [ { - "@type": "Organization", - name: "ethereum.org", - url: "https://ethereum.org", - }, - ], - breadcrumb: { - "@type": "BreadcrumbList", - itemListElement: [ - { - "@type": "ListItem", - position: 1, - name: "Home", - item: normalizeUrlForJsonLd(locale, "/"), + "@type": "WebPage", + "@id": url, + name: t("page-wallets-meta-title"), + description: t("page-wallets-meta-description"), + url: url, + inLanguage: locale, + contributor: contributorList, + author: [ethereumCommunityOrganization], + isPartOf: { + "@type": "WebSite", + "@id": "https://ethereum.org/#website", + name: "ethereum.org", + url: "https://ethereum.org", }, - { - "@type": "ListItem", - position: 2, - name: t("page-wallets-meta-title"), - item: url, + breadcrumb: { + "@type": "BreadcrumbList", + itemListElement: [ + { + "@type": "ListItem", + position: 1, + name: "Home", + item: normalizeUrlForJsonLd(locale, "/"), + }, + { + "@type": "ListItem", + position: 2, + name: t("page-wallets-meta-title"), + item: url, + }, + ], }, - ], - }, - publisher: { - "@type": "Organization", - name: "ethereum.org", - url: "https://ethereum.org", - }, - reviewedBy: { - "@type": "Organization", - name: "ethereum.org", - url: "https://ethereum.org", - logo: { - "@type": "ImageObject", - url: "https://ethereum.org/images/eth-home-icon.png", + publisher: ethereumFoundationOrganization, + reviewedBy: ethereumFoundationOrganization, + mainEntity: { "@id": `${url}#wallets` }, }, - }, - } - - // JSON-LD for the wallets guide article content - const articleJsonLd = { - "@context": "https://schema.org", - "@type": "Article", - headline: t("page-wallets-title"), - description: t("page-wallets-meta-description"), - image: "https://ethereum.org/images/wallets/wallet-hero.png", - author: [ { - "@type": "Organization", - name: "ethereum.org", - url: "https://ethereum.org", + "@type": "Article", + "@id": `${url}#wallets`, + headline: t("page-wallets-title"), + description: t("page-wallets-meta-description"), + image: "https://ethereum.org/images/wallets/wallet-hero.png", + author: [ethereumCommunityOrganization], + contributor: contributorList, + publisher: ethereumFoundationOrganization, + reviewedBy: ethereumFoundationOrganization, + about: { + "@type": "Thing", + name: "Ethereum Wallets", + description: + "Complete guide to Ethereum wallets, types, features, and how to use them safely", + }, + dateModified: lastEditLocaleTimestamp, }, ], - contributor: contributorList, - publisher: { - "@type": "Organization", - name: "ethereum.org", - url: "https://ethereum.org", - }, - reviewedBy: { - "@type": "Organization", - name: "ethereum.org", - url: "https://ethereum.org", - logo: { - "@type": "ImageObject", - url: "https://ethereum.org/images/eth-home-icon.png", - }, - }, - about: { - "@type": "Thing", - name: "Ethereum Wallets", - description: - "Complete guide to Ethereum wallets, types, features, and how to use them safely", - }, - dateModified: lastEditLocaleTimestamp, } - return + return } diff --git a/app/[locale]/what-is-ether/page-jsonld.tsx b/app/[locale]/what-is-ether/page-jsonld.tsx index e1e6afb9531..45651583da2 100644 --- a/app/[locale]/what-is-ether/page-jsonld.tsx +++ b/app/[locale]/what-is-ether/page-jsonld.tsx @@ -4,6 +4,10 @@ import { FileContributor, Lang } from "@/lib/types" import PageJsonLD from "@/components/PageJsonLD" +import { + ethereumCommunityOrganization, + ethereumFoundationOrganization, +} from "@/lib/utils/jsonld" import { normalizeUrlForJsonLd } from "@/lib/utils/url" export default async function WhatIsEtherPageJsonLD({ @@ -27,101 +31,73 @@ export default async function WhatIsEtherPageJsonLD({ url: contributor.html_url, })) - // JSON-LD structured data for the What is Ether page - const webPageJsonLd = { + const jsonLd = { "@context": "https://schema.org", - "@type": "WebPage", - "@id": url, - name: t("page-what-is-ether-meta-title"), - description: t("page-what-is-ether-meta-description"), - url: url, - inLanguage: locale, - contributor: contributorList, - author: [ + "@graph": [ { - "@type": "Organization", - name: "ethereum.org", - url: "https://ethereum.org", - }, - ], - breadcrumb: { - "@type": "BreadcrumbList", - itemListElement: [ - { - "@type": "ListItem", - position: 1, - name: "Home", - item: normalizeUrlForJsonLd(locale, "/"), + "@type": "WebPage", + "@id": url, + name: t("page-what-is-ether-meta-title"), + description: t("page-what-is-ether-meta-description"), + url: url, + inLanguage: locale, + contributor: contributorList, + author: [ethereumCommunityOrganization], + isPartOf: { + "@type": "WebSite", + "@id": "https://ethereum.org/#website", + name: "ethereum.org", + url: "https://ethereum.org", }, - { - "@type": "ListItem", - position: 2, - name: t("page-what-is-ether-title"), - item: url, + breadcrumb: { + "@type": "BreadcrumbList", + itemListElement: [ + { + "@type": "ListItem", + position: 1, + name: "Home", + item: normalizeUrlForJsonLd(locale, "/"), + }, + { + "@type": "ListItem", + position: 2, + name: t("page-what-is-ether-title"), + item: url, + }, + ], }, - ], - }, - publisher: { - "@type": "Organization", - name: "ethereum.org", - url: "https://ethereum.org", - }, - reviewedBy: { - "@type": "Organization", - name: "ethereum.org", - url: "https://ethereum.org", - logo: { - "@type": "ImageObject", - url: "https://ethereum.org/images/eth-home-icon.png", - }, - }, - } - - // JSON-LD for the article content - const articleJsonLd = { - "@context": "https://schema.org", - "@type": "Article", - headline: t("page-what-is-ether-title"), - description: t("page-what-is-ether-meta-description"), - image: "https://ethereum.org/images/eth.png", - author: [ - { - "@type": "Organization", - name: "ethereum.org", - url: "https://ethereum.org", - }, - ], - publisher: { - "@type": "Organization", - name: "ethereum.org", - url: "https://ethereum.org", - }, - contributor: contributorList, - reviewedBy: { - "@type": "Organization", - name: "ethereum.org", - url: "https://ethereum.org", - logo: { - "@type": "ImageObject", - url: "https://ethereum.org/images/eth-home-icon.png", - }, - }, - about: [ - { - "@type": "Thing", - name: "Ether (ETH)", - description: - "The native cryptocurrency of the Ethereum network used for transactions, staking, and powering applications", + publisher: ethereumFoundationOrganization, + reviewedBy: ethereumFoundationOrganization, + mainEntity: { "@id": `${url}#what-is-ether` }, }, { - "@type": "Thing", - name: "Ethereum", - description: - "A decentralized platform for applications and digital economies powered by smart contracts", + "@type": "Article", + "@id": `${url}#what-is-ether`, + headline: t("page-what-is-ether-title"), + description: t("page-what-is-ether-meta-description"), + image: "https://ethereum.org/images/eth.png", + author: [ethereumCommunityOrganization], + publisher: ethereumFoundationOrganization, + contributor: contributorList, + reviewedBy: ethereumFoundationOrganization, + about: [ + { + "@type": "Thing", + name: "Ether (ETH)", + description: + "The native cryptocurrency of the Ethereum network used for transactions, staking, and powering applications", + }, + { + "@type": "Thing", + name: "Ethereum", + description: + "A decentralized platform for applications and digital economies powered by smart contracts", + }, + ], + dateModified: lastEditLocaleTimestamp, }, ], - dateModified: lastEditLocaleTimestamp, } - return + return } diff --git a/app/[locale]/what-is-ethereum/page-jsonld.tsx b/app/[locale]/what-is-ethereum/page-jsonld.tsx index 6bc74e97e6e..edabe65f729 100644 --- a/app/[locale]/what-is-ethereum/page-jsonld.tsx +++ b/app/[locale]/what-is-ethereum/page-jsonld.tsx @@ -4,6 +4,10 @@ import { FileContributor, Lang } from "@/lib/types" import PageJsonLD from "@/components/PageJsonLD" +import { + ethereumCommunityOrganization, + ethereumFoundationOrganization, +} from "@/lib/utils/jsonld" import { normalizeUrlForJsonLd } from "@/lib/utils/url" export default async function WhatIsEthereumPageJsonLD({ @@ -27,152 +31,120 @@ export default async function WhatIsEthereumPageJsonLD({ url: contributor.html_url, })) - // JSON-LD structured data for the What is Ethereum page - const webPageJsonLd = { + const jsonLd = { "@context": "https://schema.org", - "@type": "WebPage", - "@id": url, - name: t("page-what-is-ethereum-meta-title"), - description: t("page-what-is-ethereum-meta-description"), - url: url, - inLanguage: locale, - contributor: contributorList, - author: [ + "@graph": [ { - "@type": "Organization", - name: "ethereum.org", - url: "https://ethereum.org", - }, - ], - breadcrumb: { - "@type": "BreadcrumbList", - itemListElement: [ - { - "@type": "ListItem", - position: 1, - name: "Home", - item: normalizeUrlForJsonLd(locale, "/"), - }, - { - "@type": "ListItem", - position: 2, - name: "Learn", - item: normalizeUrlForJsonLd(locale, "/learn/"), + "@type": "WebPage", + "@id": url, + name: t("page-what-is-ethereum-meta-title"), + description: t("page-what-is-ethereum-meta-description"), + url: url, + inLanguage: locale, + contributor: contributorList, + author: [ethereumCommunityOrganization], + isPartOf: { + "@type": "WebSite", + "@id": "https://ethereum.org/#website", + name: "ethereum.org", + url: "https://ethereum.org", }, - { - "@type": "ListItem", - position: 3, - name: t("page-what-is-ethereum-meta-title"), - item: url, + breadcrumb: { + "@type": "BreadcrumbList", + itemListElement: [ + { + "@type": "ListItem", + position: 1, + name: "Home", + item: normalizeUrlForJsonLd(locale, "/"), + }, + { + "@type": "ListItem", + position: 2, + name: "Learn", + item: normalizeUrlForJsonLd(locale, "/learn/"), + }, + { + "@type": "ListItem", + position: 3, + name: t("page-what-is-ethereum-meta-title"), + item: url, + }, + ], }, - ], - }, - publisher: { - "@type": "Organization", - name: "ethereum.org", - url: "https://ethereum.org", - }, - reviewedBy: { - "@type": "Organization", - name: "ethereum.org", - url: "https://ethereum.org", - logo: { - "@type": "ImageObject", - url: "https://ethereum.org/images/eth-home-icon.png", + publisher: ethereumFoundationOrganization, + reviewedBy: ethereumFoundationOrganization, + mainEntity: { "@id": `${url}#what-is-ethereum` }, }, - }, - } - - // JSON-LD for the what is ethereum article content - const articleJsonLd = { - "@context": "https://schema.org", - "@type": "Article", - headline: t("page-what-is-ethereum-title"), - description: t("page-what-is-ethereum-meta-description"), - image: "https://ethereum.org/images/what-is-ethereum.png", - author: [ { - "@type": "Organization", - name: "ethereum.org", - url: "https://ethereum.org", - }, - ], - publisher: { - "@type": "Organization", - name: "ethereum.org", - url: "https://ethereum.org", - }, - contributor: contributorList, - reviewedBy: { - "@type": "Organization", - name: "ethereum.org", - url: "https://ethereum.org", - logo: { - "@type": "ImageObject", - url: "https://ethereum.org/images/eth-home-icon.png", - }, - }, - about: { - "@type": "Thing", - name: "Ethereum", - description: - "Comprehensive guide to Ethereum, its network, capabilities, and how it works", - }, - dateModified: lastEditLocaleTimestamp, - } - - // JSON-LD for FAQ-style content covering common Ethereum questions - const faqJsonLd = { - "@context": "https://schema.org", - "@type": "FAQPage", - mainEntity: [ - { - "@type": "Question", - name: "What is Ethereum?", - acceptedAnswer: { - "@type": "Answer", - text: t("page-what-is-ethereum-hero-description-1").replace( - /<[^>]*>/g, - "" - ), - }, - }, - { - "@type": "Question", - name: "How does the Ethereum network work?", - acceptedAnswer: { - "@type": "Answer", - text: "Ethereum is a decentralized network of computers that work together to run applications and store data without a central authority.", + "@type": "Article", + "@id": `${url}#what-is-ethereum`, + headline: t("page-what-is-ethereum-title"), + description: t("page-what-is-ethereum-meta-description"), + image: "https://ethereum.org/images/what-is-ethereum.png", + author: [ethereumCommunityOrganization], + publisher: ethereumFoundationOrganization, + contributor: contributorList, + reviewedBy: ethereumFoundationOrganization, + about: { + "@type": "Thing", + name: "Ethereum", + description: + "Comprehensive guide to Ethereum, its network, capabilities, and how it works", }, + dateModified: lastEditLocaleTimestamp, }, { - "@type": "Question", - name: "What is Ether (ETH)?", - acceptedAnswer: { - "@type": "Answer", - text: "Ether is the native cryptocurrency of the Ethereum network, used to pay for transactions and computational services.", - }, - }, - { - "@type": "Question", - name: "What can you do with Ethereum?", - acceptedAnswer: { - "@type": "Answer", - text: "Ethereum enables decentralized applications, smart contracts, financial services, gaming, collectibles, and much more.", - }, - }, - { - "@type": "Question", - name: "How is Ethereum different from Bitcoin?", - acceptedAnswer: { - "@type": "Answer", - text: "While Bitcoin is primarily digital money, Ethereum is a programmable blockchain that can run applications and smart contracts.", - }, + "@type": "FAQPage", + "@id": `${url}#what-is-ethereum-faq`, + mainEntity: [ + { + "@type": "Question", + name: "What is Ethereum?", + acceptedAnswer: { + "@type": "Answer", + text: t("page-what-is-ethereum-hero-description-1").replace( + /<[^>]*>/g, + "" + ), + }, + }, + { + "@type": "Question", + name: "How does the Ethereum network work?", + acceptedAnswer: { + "@type": "Answer", + text: "Ethereum is a decentralized network of computers that work together to run applications and store data without a central authority.", + }, + }, + { + "@type": "Question", + name: "What is Ether (ETH)?", + acceptedAnswer: { + "@type": "Answer", + text: "Ether is the native cryptocurrency of the Ethereum network, used to pay for transactions and computational services.", + }, + }, + { + "@type": "Question", + name: "What can you do with Ethereum?", + acceptedAnswer: { + "@type": "Answer", + text: "Ethereum enables decentralized applications, smart contracts, financial services, gaming, collectibles, and much more.", + }, + }, + { + "@type": "Question", + name: "How is Ethereum different from Bitcoin?", + acceptedAnswer: { + "@type": "Answer", + text: "While Bitcoin is primarily digital money, Ethereum is a programmable blockchain that can run applications and smart contracts.", + }, + }, + ], }, ], } - return ( - - ) + return } diff --git a/app/[locale]/what-is-the-ethereum-network/page-jsonld.tsx b/app/[locale]/what-is-the-ethereum-network/page-jsonld.tsx index 4fda7c13109..f0971ccc3f9 100644 --- a/app/[locale]/what-is-the-ethereum-network/page-jsonld.tsx +++ b/app/[locale]/what-is-the-ethereum-network/page-jsonld.tsx @@ -4,6 +4,10 @@ import { FileContributor, Lang } from "@/lib/types" import PageJsonLD from "@/components/PageJsonLD" +import { + ethereumCommunityOrganization, + ethereumFoundationOrganization, +} from "@/lib/utils/jsonld" import { normalizeUrlForJsonLd } from "@/lib/utils/url" export default async function WhatIsTheEthereumNetworkPageJsonLD({ @@ -27,99 +31,71 @@ export default async function WhatIsTheEthereumNetworkPageJsonLD({ url: contributor.html_url, })) - // JSON-LD structured data for the What is the Ethereum Network page - const webPageJsonLd = { + const jsonLd = { "@context": "https://schema.org", - "@type": "WebPage", - "@id": url, - name: t("page-what-is-ethereum-network-meta-title"), - description: t("page-what-is-ethereum-network-meta-description"), - url: url, - inLanguage: locale, - contributor: contributorList, - author: [ + "@graph": [ { - "@type": "Organization", - name: "ethereum.org", - url: "https://ethereum.org", - }, - ], - breadcrumb: { - "@type": "BreadcrumbList", - itemListElement: [ - { - "@type": "ListItem", - position: 1, - name: "Home", - item: normalizeUrlForJsonLd(locale, "/"), + "@type": "WebPage", + "@id": url, + name: t("page-what-is-ethereum-network-meta-title"), + description: t("page-what-is-ethereum-network-meta-description"), + url: url, + inLanguage: locale, + contributor: contributorList, + author: [ethereumCommunityOrganization], + isPartOf: { + "@type": "WebSite", + "@id": "https://ethereum.org/#website", + name: "ethereum.org", + url: "https://ethereum.org", }, - { - "@type": "ListItem", - position: 2, - name: "Learn", - item: normalizeUrlForJsonLd(locale, "/learn/"), + breadcrumb: { + "@type": "BreadcrumbList", + itemListElement: [ + { + "@type": "ListItem", + position: 1, + name: "Home", + item: normalizeUrlForJsonLd(locale, "/"), + }, + { + "@type": "ListItem", + position: 2, + name: "Learn", + item: normalizeUrlForJsonLd(locale, "/learn/"), + }, + { + "@type": "ListItem", + position: 3, + name: t("page-what-is-ethereum-network-meta-title"), + item: url, + }, + ], }, - { - "@type": "ListItem", - position: 3, - name: t("page-what-is-ethereum-network-meta-title"), - item: url, - }, - ], - }, - publisher: { - "@type": "Organization", - name: "ethereum.org", - url: "https://ethereum.org", - }, - reviewedBy: { - "@type": "Organization", - name: "ethereum.org", - url: "https://ethereum.org", - logo: { - "@type": "ImageObject", - url: "https://ethereum.org/images/eth-home-icon.png", + publisher: ethereumFoundationOrganization, + reviewedBy: ethereumFoundationOrganization, + mainEntity: { "@id": `${url}#what-is-the-ethereum-network` }, }, - }, - } - - // JSON-LD for the ethereum network article content - const articleJsonLd = { - "@context": "https://schema.org", - "@type": "Article", - headline: t("page-what-is-ethereum-network-title"), - description: t("page-what-is-ethereum-network-meta-description"), - image: "https://ethereum.org/images/what-is-ethereum-network.png", - author: [ { - "@type": "Organization", - name: "ethereum.org", - url: "https://ethereum.org", + "@type": "Article", + "@id": `${url}#what-is-the-ethereum-network`, + headline: t("page-what-is-ethereum-network-title"), + description: t("page-what-is-ethereum-network-meta-description"), + image: "https://ethereum.org/images/what-is-ethereum-network.png", + author: [ethereumCommunityOrganization], + publisher: ethereumFoundationOrganization, + contributor: contributorList, + reviewedBy: ethereumFoundationOrganization, + about: { + "@type": "Thing", + name: "Ethereum Network", + description: + "Comprehensive guide to the Ethereum network, including fees, staking, layer 2 solutions, and live network data", + }, + dateModified: lastEditLocaleTimestamp, }, ], - publisher: { - "@type": "Organization", - name: "ethereum.org", - url: "https://ethereum.org", - }, - contributor: contributorList, - reviewedBy: { - "@type": "Organization", - name: "ethereum.org", - url: "https://ethereum.org", - logo: { - "@type": "ImageObject", - url: "https://ethereum.org/images/eth-home-icon.png", - }, - }, - about: { - "@type": "Thing", - name: "Ethereum Network", - description: - "Comprehensive guide to the Ethereum network, including fees, staking, layer 2 solutions, and live network data", - }, - dateModified: lastEditLocaleTimestamp, } - return + return } diff --git a/src/lib/utils/jsonld.ts b/src/lib/utils/jsonld.ts new file mode 100644 index 00000000000..58af94baef3 --- /dev/null +++ b/src/lib/utils/jsonld.ts @@ -0,0 +1,40 @@ +/** + * Shared JSON-LD structured data definitions + * These can be imported and reused across page-jsonld.tsx files + */ + +/** + * Ethereum Foundation organization definition + * Can be used as publisher, maintainer, author, etc. + */ +export const ethereumFoundationOrganization = { + "@type": "Organization" as const, + "@id": "https://ethereum.foundation/#organization", + name: "Ethereum Foundation", + url: "https://ethereum.foundation", + ownershipFundingInfo: "https://ethereum.foundation/ef", + logo: "https://ethereum.org/images/ef-logo.png", + sameAs: [ + "https://www.wikidata.org/wiki/Q114736857", + "https://www.crunchbase.com/organization/ethereum", + "https://x.com/ethereumfndn", + "https://www.linkedin.com/company/ethereum-foundation", + ], +} + +/** + * Reference to Ethereum Foundation organization (for use when the full object is already defined elsewhere) + */ +export const ethereumFoundationReference = { + "@id": "https://ethereum.foundation/#organization", +} + +/** + * Ethereum Community contributor organization + */ +export const ethereumCommunityOrganization = { + "@type": "Organization" as const, + name: "Ethereum Community", + url: "https://github.com/ethereum/ethereum-org-website/graphs/contributors", + description: "A global collective of open-source contributors.", +}