Skip to content

Commit 6db03fb

Browse files
authored
Merge pull request #17988 from ethereum/jsonld-authors
seo(jsonld): initialize author profiles
2 parents 1f594f9 + 0ce4532 commit 6db03fb

60 files changed

Lines changed: 640 additions & 55 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

app/[locale]/10years/page-jsonld.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,10 @@ import { FileContributor } from "@/lib/types"
44

55
import PageJsonLD from "@/components/PageJsonLD"
66

7-
import { BASE_GRAPH_NODES, REFERENCE } from "@/lib/jsonld/constants"
87
import { normalizeUrlForJsonLd } from "@/lib/utils/url"
98

9+
import { BASE_GRAPH_NODES, REFERENCE } from "@/lib/jsonld/constants"
10+
1011
export default async function TenYearJsonLD({
1112
locale,
1213
contributors,

app/[locale]/[...slug]/page-jsonld.tsx

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,11 @@ import { FileContributor, Frontmatter } from "@/lib/types"
22

33
import PageJsonLD from "@/components/PageJsonLD"
44

5-
import { BASE_GRAPH_NODES, REFERENCE } from "@/lib/jsonld/constants"
65
import { normalizeUrlForJsonLd } from "@/lib/utils/url"
76

7+
import { BASE_GRAPH_NODES, REFERENCE } from "@/lib/jsonld/constants"
8+
import { resolveAuthorsFromFrontmatter } from "@/lib/jsonld/utils"
9+
810
export default async function SlugJsonLD({
911
locale,
1012
slug,
@@ -49,18 +51,23 @@ export default async function SlugJsonLD({
4951
url: contributor.html_url,
5052
}))
5153

54+
const { authorGraphNodes, authorIds } = resolveAuthorsFromFrontmatter(
55+
frontmatter.authors ?? frontmatter.author
56+
)
57+
5258
const jsonLd = {
5359
"@context": "https://schema.org",
5460
"@graph": [
5561
...BASE_GRAPH_NODES,
62+
...authorGraphNodes,
5663
{
5764
"@type": "WebPage",
5865
"@id": url,
5966
name: frontmatter.title,
6067
description: frontmatter.description,
6168
url: url,
6269
inLanguage: locale,
63-
author: [REFERENCE.ETHEREUM_COMMUNITY],
70+
author: authorIds,
6471
contributor: contributorList,
6572
isPartOf: REFERENCE.ETHEREUM_ORG_WEBSITE,
6673
breadcrumb: {
@@ -79,7 +86,7 @@ export default async function SlugJsonLD({
7986
image: frontmatter.image
8087
? `https://ethereum.org${frontmatter.image}`
8188
: undefined,
82-
author: [REFERENCE.ETHEREUM_COMMUNITY],
89+
author: authorIds,
8390
contributor: contributorList,
8491
publisher: REFERENCE.ETHEREUM_FOUNDATION,
8592
dateModified: frontmatter.published,

app/[locale]/apps/[application]/page-jsonld.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,10 @@ import { AppCategory, AppData, FileContributor } from "@/lib/types"
22

33
import PageJsonLD from "@/components/PageJsonLD"
44

5-
import { BASE_GRAPH_NODES, REFERENCE } from "@/lib/jsonld/constants"
65
import { normalizeUrlForJsonLd, slugify } from "@/lib/utils/url"
76

7+
import { BASE_GRAPH_NODES, REFERENCE } from "@/lib/jsonld/constants"
8+
89
// Map internal app categories to schema.org enumerated applicationCategory values
910
// https://schema.org/applicationCategory
1011
const APPLICATION_CATEGORY_MAP: Record<AppCategory, string> = {

app/[locale]/apps/categories/[catetgoryName]/page-jsonld.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,10 @@ import { AppCategoryData, AppData, FileContributor } from "@/lib/types"
44

55
import PageJsonLD from "@/components/PageJsonLD"
66

7-
import { BASE_GRAPH_NODES, REFERENCE } from "@/lib/jsonld/constants"
87
import { normalizeUrlForJsonLd } from "@/lib/utils/url"
98

9+
import { BASE_GRAPH_NODES, REFERENCE } from "@/lib/jsonld/constants"
10+
1011
export default async function AppsCategoryJsonLD({
1112
locale,
1213
categoryName,

app/[locale]/apps/page-jsonld.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,12 @@ import { FileContributor } from "@/lib/types"
44

55
import PageJsonLD from "@/components/PageJsonLD"
66

7-
import { BASE_GRAPH_NODES, REFERENCE } from "@/lib/jsonld/constants"
87
import { normalizeUrlForJsonLd } from "@/lib/utils/url"
98

109
import { appsCategories } from "@/data/apps/categories"
1110

11+
import { BASE_GRAPH_NODES, REFERENCE } from "@/lib/jsonld/constants"
12+
1213
export default async function AppsJsonLD({
1314
locale,
1415
contributors,

app/[locale]/assets/page-jsonld.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,10 @@ import { FileContributor } from "@/lib/types"
44

55
import PageJsonLD from "@/components/PageJsonLD"
66

7-
import { BASE_GRAPH_NODES, REFERENCE } from "@/lib/jsonld/constants"
87
import { normalizeUrlForJsonLd } from "@/lib/utils/url"
98

9+
import { BASE_GRAPH_NODES, REFERENCE } from "@/lib/jsonld/constants"
10+
1011
export default async function AssetsJsonLD({
1112
locale,
1213
contributors,

app/[locale]/bug-bounty/page-jsonld.tsx

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,12 @@ import { FileContributor } from "@/lib/types"
44

55
import PageJsonLD from "@/components/PageJsonLD"
66

7-
import { BASE_GRAPH_NODES, REFERENCE } from "@/lib/jsonld/constants"
87
import { normalizeUrlForJsonLd } from "@/lib/utils/url"
98

9+
import { BASE_GRAPH_NODES, REFERENCE } from "@/lib/jsonld/constants"
10+
import { KNOWN_PERSONS } from "@/lib/jsonld/persons"
11+
import { personReference } from "@/lib/jsonld/utils"
12+
1013
export default async function BugBountyJsonLD({
1114
locale,
1215
contributors,
@@ -27,6 +30,7 @@ export default async function BugBountyJsonLD({
2730
const jsonLd = {
2831
"@context": "https://schema.org",
2932
"@graph": [
33+
KNOWN_PERSONS["fredrik-svantes"],
3034
...BASE_GRAPH_NODES,
3135
{
3236
"@type": "WebPage",
@@ -36,7 +40,10 @@ export default async function BugBountyJsonLD({
3640
url: url,
3741
inLanguage: locale,
3842
contributor: contributorList,
39-
author: [REFERENCE.ETHEREUM_COMMUNITY],
43+
author: [
44+
personReference("fredrik-svantes"),
45+
REFERENCE.ETHEREUM_COMMUNITY,
46+
],
4047
isPartOf: REFERENCE.ETHEREUM_ORG_WEBSITE,
4148
breadcrumb: {
4249
"@type": "BreadcrumbList",

app/[locale]/collectibles/page-jsonld.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,13 @@ import { FileContributor } from "@/lib/types"
44

55
import PageJsonLD from "@/components/PageJsonLD"
66

7-
import { BASE_GRAPH_NODES, REFERENCE } from "@/lib/jsonld/constants"
87
import { normalizeUrlForJsonLd } from "@/lib/utils/url"
98

109
import { COLLECTIBLES_BASE_URL } from "./constants"
1110
import type { Badge, Stats } from "./types"
1211

12+
import { BASE_GRAPH_NODES, REFERENCE } from "@/lib/jsonld/constants"
13+
1314
export default async function CollectiblesJsonLD({
1415
locale,
1516
badges,

app/[locale]/community/support/types.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
import type { ForwardRefExoticComponent, RefAttributes } from "react"
21
import { type LucideProps } from "lucide-react"
2+
import type { ForwardRefExoticComponent, RefAttributes } from "react"
33

44
export type ItemSection = {
55
titleKey: string

app/[locale]/contributing/translation-program/acknowledgements/page-jsonld.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,10 @@ import { FileContributor } from "@/lib/types"
44

55
import PageJsonLD from "@/components/PageJsonLD"
66

7-
import { BASE_GRAPH_NODES, REFERENCE } from "@/lib/jsonld/constants"
87
import { normalizeUrlForJsonLd } from "@/lib/utils/url"
98

9+
import { BASE_GRAPH_NODES, REFERENCE } from "@/lib/jsonld/constants"
10+
1011
export default async function AcknowledgementsJsonLD({
1112
locale,
1213
contributors,

0 commit comments

Comments
 (0)