Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 23 additions & 3 deletions app/[locale]/apps/[application]/page-jsonld.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { AppData, FileContributor } from "@/lib/types"
import { AppCategory, AppData, FileContributor } from "@/lib/types"

import PageJsonLD from "@/components/PageJsonLD"

Expand All @@ -8,6 +8,19 @@ import {
} from "@/lib/utils/jsonld"
import { normalizeUrlForJsonLd, slugify } from "@/lib/utils/url"

// Map internal app categories to schema.org enumerated applicationCategory values
// https://schema.org/applicationCategory
const APPLICATION_CATEGORY_MAP: Record<AppCategory, string> = {
DeFi: "FinanceApplication",
Collectibles: "EntertainmentApplication",
Social: "SocialNetworkingApplication",
Gaming: "GameApplication",
Bridge: "UtilitiesApplication",
Productivity: "BusinessApplication",
Privacy: "SecurityApplication",
DAO: "BusinessApplication",
}

export default async function AppsAppJsonLD({
locale,
app,
Expand Down Expand Up @@ -71,15 +84,22 @@ export default async function AppsAppJsonLD({
mainEntity: { "@id": `${url}#applications` },
},
{
"@type": "SoftwareApplication",
"@type": "WebApplication",
"@id": `${url}#applications`,
name: app.name,
description: app.description,
url: app.url,
image: app.image,
applicationCategory: app.category,
applicationCategory:
APPLICATION_CATEGORY_MAP[app.category] ?? "UtilitiesApplication",
applicationSubCategory: app.subCategory.join(", "),
operatingSystem: "Web Browser",
offers: {
"@type": "Offer",
price: "0",
priceCurrency: "USD",
availability: "https://schema.org/OnlineOnly",
},
author: [
{
"@type": "Organization",
Expand Down
8 changes: 6 additions & 2 deletions app/[locale]/community/events/page-jsonld.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,9 @@ function buildHubSchemaNodes(
if (schema.address) {
placeNode.address = {
"@type": "PostalAddress" as const,
streetAddress: schema.address.streetAddress,
...(schema.address.streetAddress && {
streetAddress: schema.address.streetAddress,
}),
addressLocality: schema.address.addressLocality,
...(schema.address.postalCode && {
postalCode: schema.address.postalCode,
Expand All @@ -56,7 +58,7 @@ function buildHubSchemaNodes(

if (schema.containedInPlace) {
placeNode.containedInPlace = {
"@type": "LocalBusiness" as const,
"@type": "Place" as const,
name: schema.containedInPlace.name,
...(schema.containedInPlace.url && {
url: schema.containedInPlace.url,
Expand All @@ -69,6 +71,8 @@ function buildHubSchemaNodes(
"@id": seriesId,
name: schema.eventSeriesName ?? "Open Ethereum Coworking Hours",
description: schema.eventDescription,
startDate:
schema.schedule.startDate ?? new Date().toISOString().split("T")[0],
isAccessibleForFree: true,
url: hub.coworkingSignupUrl,
eventStatus: "https://schema.org/EventScheduled",
Expand Down
9 changes: 6 additions & 3 deletions app/[locale]/developers/tutorials/page-jsonld.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -87,12 +87,15 @@ export default async function TutorialsPageJsonLD({
"@type": "ListItem",
position: index + 1,
name: tutorial.title,
url: tutorial.href,
url: normalizeUrlForJsonLd(locale, tutorial.href),
item: {
"@type": "Course",
name: tutorial.title,
description: tutorial.description,
url: tutorial.href,
description:
tutorial.description.length > 60
? tutorial.description.slice(0, 57) + "..."
: tutorial.description,
url: normalizeUrlForJsonLd(locale, tutorial.href),
provider: ethereumFoundationOrganization,
courseMode: "online",
educationalLevel: tutorial.skill ?? "beginner",
Expand Down
6 changes: 5 additions & 1 deletion src/data/community-hub-schemas.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ export type CommunityHubSchemaData = {
eventSeriesName?: string
eventDescription: string
address?: {
streetAddress: string
streetAddress?: string
addressLocality: string
postalCode?: string
addressCountry: string
Expand Down Expand Up @@ -68,6 +68,10 @@ export const communityHubSchemas: Record<string, CommunityHubSchemaData> = {
eventSeriesName: "Ethereum Community Hub Berlin -- Co-working Wednesdays",
eventDescription:
"Every Wednesday the Ethereum Foundation office opens for builders, researchers, creators, students, and explorers to co-work, connect, and collaborate.",
address: {
addressLocality: "Berlin",
addressCountry: "DE",
},
schedule: {
startTime: "10:00",
endTime: "20:00",
Expand Down
Loading