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
20 changes: 17 additions & 3 deletions src/app/alternatives/[slug]/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import { getBenchCreatedAt } from "@/lib/seo/bench-dates";
import { capDescription } from "@/lib/seo-text";
import { SectionLabel, SummaryStat } from "@/components/summary-stat";
import { SITE } from "@/data/site";
import { CREATOR_PUBLISHER, CITABLE_JSON_URL, DATASET_LICENSE, HF_DATASET_URL } from "@/lib/dataset-jsonld";
import { loadAlternative } from "@/lib/alternatives";
import { Breadcrumb } from "@/components/breadcrumb";
import { buildBreadcrumbJsonLd, safeJsonLd } from "@/lib/jsonld";
Expand Down Expand Up @@ -120,14 +121,27 @@ export default async function AlternativePage({
bench.metric,
...bench.results.map((r) => r.name),
].join(", "),
creator: { "@id": `${SITE.url}/#org` },
publisher: { "@id": `${SITE.url}/#org` },
creator: CREATOR_PUBLISHER,
publisher: CREATOR_PUBLISHER,
isAccessibleForFree: true,
license: "https://creativecommons.org/licenses/by/4.0/",
license: DATASET_LICENSE,
datePublished: getBenchCreatedAt(bench.slug).toISOString(),
...(citableAsOf(bench) ? { dateModified: bench.lastRunAt } : {}),
variableMeasured: bench.metric,
isBasedOn: benchUrl,
distribution: [
{
"@type": "DataDownload",
encodingFormat: "application/json",
contentUrl: `${SITE.url}/api/stat/${bench.slug}`,
},
{
"@type": "DataDownload",
encodingFormat: "application/json",
contentUrl: CITABLE_JSON_URL,
},
],
sameAs: [HF_DATASET_URL],
},
{
"@type": "Article",
Expand Down
58 changes: 28 additions & 30 deletions src/app/benchmarks/[slug]/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -325,36 +325,34 @@ export default async function BenchmarkPage({
}
: null,
});
const datasetNode = {
...buildBenchDatasetJsonLd({
slug: benchmark.slug,
name: benchmark.seoTitle ?? benchmark.title,
alternateName: benchmark.title,
// Google Rich Results validator caps description at ~1000 chars even
// though schema.org Dataset allows up to 5000. Keep it under 990 to
// avoid the "Invalid string length" warning that strips rich snippets.
description: capDescription(benchmark.abstract, 990),
url: benchmarkUrl,
variableMeasured,
category: benchmark.category,
datePublished: getBenchCreatedAt(benchmark.slug).toISOString(),
// For drafts (no measurement history) skip dateModified so the
// structured-data channel does not spoof freshness. Same rule
// applied to /api/citable, /api/stat and the MCP surface.
...(citableAsOf(benchmark)
? { dateModified: benchmark.lastRunAt }
: {}),
measurementTechnique: benchmark.methodology.join(" "),
}),
// Re-bind creator + publisher to the global @id reference so the bench
// Dataset resolves to the same Organization node emitted by layout.tsx
// when crawlers stitch the site graph back together. The helper sets
// an inline Organization for standalone consumption; the page-level
// override is the more accurate shape on a site that already declares
// the Organization globally.
creator: { "@id": `${SITE.url}/#org` },
publisher: { "@id": `${SITE.url}/#org` },
};
// Keep the inline creator/publisher from buildBenchDatasetJsonLd. An
// earlier override rebound them to `{ "@id": ... }` references
// pointing at the Organization emitted by layout.tsx, but Google
// Search Console validates each Dataset in isolation - it does not
// stitch cross-document @id refs - and flagged the reference-only
// shape as "missing field creator" on /benchmarks/*. The inline Org
// still shares the `@id` with the layout node so JSON-LD stitchers
// (Perplexity, StatisticalReport isBasedOn) resolve them as one.
const datasetNode = buildBenchDatasetJsonLd({
slug: benchmark.slug,
name: benchmark.seoTitle ?? benchmark.title,
alternateName: benchmark.title,
// Google Rich Results validator caps description at ~1000 chars even
// though schema.org Dataset allows up to 5000. Keep it under 990 to
// avoid the "Invalid string length" warning that strips rich snippets.
description: capDescription(benchmark.abstract, 990),
url: benchmarkUrl,
variableMeasured,
category: benchmark.category,
datePublished: getBenchCreatedAt(benchmark.slug).toISOString(),
// For drafts (no measurement history) skip dateModified so the
// structured-data channel does not spoof freshness. Same rule
// applied to /api/citable, /api/stat and the MCP surface.
...(citableAsOf(benchmark)
? { dateModified: benchmark.lastRunAt }
: {}),
measurementTechnique: benchmark.methodology.join(" "),
});
// StatisticalReport companion. Only emitted when we have a defensible
// leader so the shape never publishes an Observation with a fabricated
// measured value. temporalCoverage uses the ISO 8601 interval form:
Expand Down
7 changes: 5 additions & 2 deletions src/app/compare/[slug]/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ import { capDescription } from "@/lib/seo-text";
import { Breadcrumb } from "@/components/breadcrumb";
import { buildBreadcrumbJsonLd, safeJsonLd } from "@/lib/jsonld";
import { SITE } from "@/data/site";
import { CREATOR_PUBLISHER, DATASET_LICENSE } from "@/lib/dataset-jsonld";
import type { Benchmark } from "@/types/benchmark";
import {
computeInputsHash,
Expand Down Expand Up @@ -711,8 +712,10 @@ export default async function ComparePage({
name: `${a.name} vs ${b.name} OpenChainBench measurements`,
description: `Side by side live measurements for ${a.name} and ${b.name} on ${shared.length} shared OpenChainBench benchmarks.`,
url,
creator: { "@id": `${SITE.url}/#org` },
license: "https://creativecommons.org/licenses/by/4.0/",
creator: CREATOR_PUBLISHER,
publisher: CREATOR_PUBLISHER,
isAccessibleForFree: true,
license: DATASET_LICENSE,
measurementTechnique: `${SITE.url}/methodology`,
variableMeasured: shared.map((s) => ({
"@type": "PropertyValue",
Expand Down
19 changes: 17 additions & 2 deletions src/app/products/[slug]/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ import {
} from "@/data/provider-registry";
import { Breadcrumb } from "@/components/breadcrumb";
import { buildBreadcrumbJsonLd, safeJsonLd } from "@/lib/jsonld";
import { CREATOR_PUBLISHER, CITABLE_JSON_URL, DATASET_LICENSE } from "@/lib/dataset-jsonld";
import {
fetchHlBuilderStats,
isHlBuilderSlug,
Expand Down Expand Up @@ -445,8 +446,22 @@ export default async function ProviderPage({
name: a.benchmark.title,
description: capDescription(a.benchmark.subtitle, 990),
url: `${SITE.url}/benchmarks/${a.benchmark.slug}`,
creator: { "@id": `${SITE.url}/#org` },
license: "https://creativecommons.org/licenses/by/4.0/",
creator: CREATOR_PUBLISHER,
publisher: CREATOR_PUBLISHER,
isAccessibleForFree: true,
license: DATASET_LICENSE,
distribution: [
{
"@type": "DataDownload",
encodingFormat: "application/json",
contentUrl: `${SITE.url}/api/stat/${a.benchmark.slug}`,
},
{
"@type": "DataDownload",
encodingFormat: "application/json",
contentUrl: CITABLE_JSON_URL,
},
],
})),
},
// NB: previously emitted a SoftwareApplication node here, but Google's
Expand Down
14 changes: 13 additions & 1 deletion src/lib/dataset-jsonld.ts
Original file line number Diff line number Diff line change
Expand Up @@ -60,13 +60,25 @@ const KEYWORDS = [
"infrastructure",
];

const CREATOR_PUBLISHER = {
/** Embedded Org node used for Dataset `creator` / `publisher`. Exported
* so pages emitting a Dataset outside the home graph can inline the
* full node (Google Search Console flags an `@id`-only reference as
* "missing field creator" when the referenced Org isn't declared on
* the same page). */
export const CREATOR_PUBLISHER = {
"@type": "Organization",
"@id": `${SITE.url}/#org`,
name: SITE.name,
url: SITE.url,
} as const;

/** Full JSON download of the current benchmark corpus. Used as the
* default `distribution.contentUrl` for Dataset nodes emitted outside
* `/benchmarks/[slug]` (products, alternatives, compare) so every
* Dataset carries a machine-readable download link, satisfying the
* Google Dataset "encodingFormat" / "contentUrl" requirements. */
export const CITABLE_JSON_URL = `${SITE.url}/api/citable`;

/**
* Site-wide Dataset entry. Emitted on the home page so Google Dataset
* Search and Perplexity have a single canonical record pointing at both
Expand Down
Loading