Files
0pt/app/katalog/[id]/layout.tsx
T
siax-bot 860bb22aef
CI (SIAX Cloud) / sonar (pull_request) Skipped
masterplan-lock / check (pull_request) Successful in 9s
CI (SIAX Cloud) / Component conformance (blocking) (pull_request) Successful in 13s
CI (SIAX Cloud) / security (pull_request) Successful in 20s
security / scan (pull_request) Failing after 43s
CI (SIAX Cloud) / quality (pull_request) Failing after 3m11s
CI (SIAX Cloud) / integration (pull_request) Successful in 3m41s
SEO: drop noindex order steps from sitemap + per-dataset detail metadata
- sitemap now lists only public landing pages; /bestall* (noindex per PR #622)
  is no longer announced to crawlers.
- /katalog/[id] gets route-level generateMetadata with a unique title,
  description and canonical per dataset instead of inheriting /katalog's
  canonical. Unknown ids are explicitly noindex with canonical back to catalog.
- Dataset seed extracted to app/katalog/datasets.ts so the client detail page
  and server metadata share one source of truth.
- 10 regression tests covering home/catalog/two datasets/order step and
  sitemap+robots.
2026-11-17 18:22:35 +01:00

40 lines
1.4 KiB
TypeScript

import type { Metadata } from "next";
import { findDataset } from "@/app/katalog/datasets";
const BASE = "https://0pt.app";
// A dataset detail is a real, indexable search target: it has its own title,
// description and content, and is linked from /katalog. Without its own
// metadata it inherits the parent /katalog canonical and search engines fold
// every dataset into the catalog page. Route-level generateMetadata is the
// existing Next mechanism for per-dataset metadata; the detail page itself
// stays a client component.
export async function generateMetadata({
params,
}: {
params: Promise<{ id: string }>;
}): Promise<Metadata> {
const { id } = await params;
const dataset = findDataset(id);
if (!dataset) {
// An unknown id renders the client-side "dataset does not exist" state.
// Make the policy explicit: not indexable, canonical back to the catalog.
return {
title: "Dataset not found — 0pt",
alternates: { canonical: `${BASE}/katalog` },
robots: { index: false, follow: true },
};
}
return {
title: `${dataset.title.en} — 0pt`,
description: `${dataset.blurb.en} ${dataset.count.en} across ${dataset.markets}. Provenance per field and transparent pricing.`,
alternates: { canonical: `${BASE}/katalog/${dataset.id}` },
};
}
export default function DatasetDetailLayout({ children }: { children: React.ReactNode }) {
return children;
}