SEO: drop noindex order steps from sitemap + per-dataset detail metadata
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
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
- 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.
This commit is contained in:
@@ -0,0 +1,39 @@
|
||||
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;
|
||||
}
|
||||
+1
-119
@@ -11,119 +11,7 @@ import { LoadingSkeleton, EmptyState, ErrorState } from "@/components/states";
|
||||
import { useReveal } from "@/hooks/use-reveal";
|
||||
import { FIELDS, SAMPLE_ROWS, MARKETS, formatSEK, type ProvLevel } from "@/lib/data";
|
||||
import type { Loc } from "@/lib/data";
|
||||
|
||||
// ─────────────────────────────────────────────────────────────────────────────
|
||||
// Inline catalog. No detail API yet — keyed by slugified id with a safe fallback.
|
||||
// ─────────────────────────────────────────────────────────────────────────────
|
||||
|
||||
interface Dataset {
|
||||
id: string;
|
||||
markets: string;
|
||||
marketCodes: string[];
|
||||
title: Loc;
|
||||
blurb: Loc;
|
||||
count: Loc;
|
||||
rows: number;
|
||||
freshness: Loc;
|
||||
level: ProvLevel;
|
||||
source: string;
|
||||
cat: Loc;
|
||||
price: number;
|
||||
artifact: "table" | "map" | "schema" | "chart";
|
||||
}
|
||||
|
||||
const CATALOG: Dataset[] = [
|
||||
{
|
||||
id: "nordic-companies",
|
||||
markets: "SE · NO · DK · FI",
|
||||
marketCodes: ["SE", "NO", "DK", "FI"],
|
||||
title: { en: "Nordic company data", sv: "Nordisk bolagsdata" },
|
||||
blurb: { en: "Official registers. Per field.", sv: "Officiella register. Per fält." },
|
||||
count: { en: "4.9M records", sv: "4,9M poster" },
|
||||
rows: 4900000,
|
||||
freshness: { en: "daily", sv: "daglig" },
|
||||
level: 3,
|
||||
source: "GLEIF · Brreg",
|
||||
cat: { en: "Companies", sv: "Bolag" },
|
||||
price: 18400,
|
||||
artifact: "table",
|
||||
},
|
||||
{
|
||||
id: "tech-decisionmakers",
|
||||
markets: "SE · NO · DK · FI",
|
||||
marketCodes: ["SE", "NO", "DK", "FI"],
|
||||
title: { en: "Decision-makers in tech", sv: "Beslutsfattare i tech" },
|
||||
blurb: { en: "Role and path. Source per field.", sv: "Roll och väg. Källa per fält." },
|
||||
count: { en: "182k records", sv: "182k poster" },
|
||||
rows: 182000,
|
||||
freshness: { en: "weekly", sv: "veckovis" },
|
||||
level: 1,
|
||||
source: "public web",
|
||||
cat: { en: "Decision-makers", sv: "Beslutsfattare" },
|
||||
price: 9600,
|
||||
artifact: "schema",
|
||||
},
|
||||
{
|
||||
id: "vehicles-fleet",
|
||||
markets: "SE",
|
||||
marketCodes: ["SE"],
|
||||
title: { en: "Vehicles & fleet", sv: "Fordon & flotta" },
|
||||
blurb: { en: "Technical data. VehIQ synergy.", sv: "Tekniska data. VehIQ-synergin." },
|
||||
count: { en: "6.1M records", sv: "6,1M poster" },
|
||||
rows: 6100000,
|
||||
freshness: { en: "daily", sv: "daglig" },
|
||||
level: 2,
|
||||
source: "register",
|
||||
cat: { en: "Vehicles", sv: "Fordon" },
|
||||
price: 12200,
|
||||
artifact: "map",
|
||||
},
|
||||
{
|
||||
id: "financial-series",
|
||||
markets: "SE · NO · DK · FI",
|
||||
marketCodes: ["SE", "NO", "DK", "FI"],
|
||||
title: { en: "Financial series", sv: "Finansiella serier" },
|
||||
blurb: { en: "Revenue, result, KPIs.", sv: "Omsättning, resultat, nyckeltal." },
|
||||
count: { en: "12 years", sv: "12 år" },
|
||||
rows: 240000,
|
||||
freshness: { en: "annual", sv: "årlig" },
|
||||
level: 2,
|
||||
source: "register",
|
||||
cat: { en: "Financials", sv: "Finansiellt" },
|
||||
price: 14800,
|
||||
artifact: "chart",
|
||||
},
|
||||
{
|
||||
id: "buying-signals",
|
||||
markets: "SE · NO · DK · FI",
|
||||
marketCodes: ["SE", "NO", "DK", "FI"],
|
||||
title: { en: "Buying signals", sv: "Köpsignaler" },
|
||||
blurb: { en: "Ads, news, tech changes. Intent per company.", sv: "Annonser, nyheter, teknikbyten. Intent per bolag." },
|
||||
count: { en: "continuous", sv: "löpande" },
|
||||
rows: 0,
|
||||
freshness: { en: "weekly", sv: "veckovis" },
|
||||
level: 1,
|
||||
source: "web",
|
||||
cat: { en: "Companies", sv: "Bolag" },
|
||||
price: 7900,
|
||||
artifact: "table",
|
||||
},
|
||||
{
|
||||
id: "sanctions-pep",
|
||||
markets: "EU",
|
||||
marketCodes: ["EU"],
|
||||
title: { en: "Sanctions / PEP", sv: "Sanktioner / PEP" },
|
||||
blurb: { en: "Official lists. Automated screening.", sv: "Officiella listor. Automatisk screening." },
|
||||
count: { en: "global", sv: "global" },
|
||||
rows: 0,
|
||||
freshness: { en: "daily", sv: "daglig" },
|
||||
level: 3,
|
||||
source: "OpenSanctions",
|
||||
cat: { en: "Compliance", sv: "Efterlevnad" },
|
||||
price: 5900,
|
||||
artifact: "table",
|
||||
},
|
||||
];
|
||||
import { findDataset, type Dataset } from "@/app/katalog/datasets";
|
||||
|
||||
// Stable tab keys — never change, display labels are localized separately
|
||||
type TabKey = "overview" | "samples" | "quality" | "schema" | "coverage" | "price";
|
||||
@@ -136,12 +24,6 @@ const TABS: { key: TabKey; label: Loc }[] = [
|
||||
{ key: "price", label: { en: "Price", sv: "Pris" } },
|
||||
];
|
||||
|
||||
function findDataset(raw: string | undefined): Dataset | undefined {
|
||||
if (!raw) return undefined;
|
||||
const slug = decodeURIComponent(raw).toLowerCase();
|
||||
return CATALOG.find((d) => d.id === slug);
|
||||
}
|
||||
|
||||
const TAB_KEYS = TABS.map((t) => t.key);
|
||||
function isTabKey(value: string | null): value is TabKey {
|
||||
return value !== null && (TAB_KEYS as string[]).includes(value);
|
||||
|
||||
@@ -0,0 +1,124 @@
|
||||
import type { Loc, ProvLevel } from "@/lib/data";
|
||||
|
||||
// Single source of truth for the ready-made datasets shown under /katalog.
|
||||
// Kept framework-neutral (no "use client") so both the client detail page and
|
||||
// the route's server-side generateMetadata resolve the same ids and titles.
|
||||
|
||||
// ─────────────────────────────────────────────────────────────────────────────
|
||||
// Static dataset seed (no detail API yet) — keyed by slugified id with a safe fallback.
|
||||
// ─────────────────────────────────────────────────────────────────────────────
|
||||
|
||||
export interface Dataset {
|
||||
id: string;
|
||||
markets: string;
|
||||
marketCodes: string[];
|
||||
title: Loc;
|
||||
blurb: Loc;
|
||||
count: Loc;
|
||||
rows: number;
|
||||
freshness: Loc;
|
||||
level: ProvLevel;
|
||||
source: string;
|
||||
cat: Loc;
|
||||
price: number;
|
||||
artifact: "table" | "map" | "schema" | "chart";
|
||||
}
|
||||
|
||||
export const CATALOG: Dataset[] = [
|
||||
{
|
||||
id: "nordic-companies",
|
||||
markets: "SE · NO · DK · FI",
|
||||
marketCodes: ["SE", "NO", "DK", "FI"],
|
||||
title: { en: "Nordic company data", sv: "Nordisk bolagsdata" },
|
||||
blurb: { en: "Official registers. Per field.", sv: "Officiella register. Per fält." },
|
||||
count: { en: "4.9M records", sv: "4,9M poster" },
|
||||
rows: 4900000,
|
||||
freshness: { en: "daily", sv: "daglig" },
|
||||
level: 3,
|
||||
source: "GLEIF · Brreg",
|
||||
cat: { en: "Companies", sv: "Bolag" },
|
||||
price: 18400,
|
||||
artifact: "table",
|
||||
},
|
||||
{
|
||||
id: "tech-decisionmakers",
|
||||
markets: "SE · NO · DK · FI",
|
||||
marketCodes: ["SE", "NO", "DK", "FI"],
|
||||
title: { en: "Decision-makers in tech", sv: "Beslutsfattare i tech" },
|
||||
blurb: { en: "Role and path. Source per field.", sv: "Roll och väg. Källa per fält." },
|
||||
count: { en: "182k records", sv: "182k poster" },
|
||||
rows: 182000,
|
||||
freshness: { en: "weekly", sv: "veckovis" },
|
||||
level: 1,
|
||||
source: "public web",
|
||||
cat: { en: "Decision-makers", sv: "Beslutsfattare" },
|
||||
price: 9600,
|
||||
artifact: "schema",
|
||||
},
|
||||
{
|
||||
id: "vehicles-fleet",
|
||||
markets: "SE",
|
||||
marketCodes: ["SE"],
|
||||
title: { en: "Vehicles & fleet", sv: "Fordon & flotta" },
|
||||
blurb: { en: "Technical data. VehIQ synergy.", sv: "Tekniska data. VehIQ-synergin." },
|
||||
count: { en: "6.1M records", sv: "6,1M poster" },
|
||||
rows: 6100000,
|
||||
freshness: { en: "daily", sv: "daglig" },
|
||||
level: 2,
|
||||
source: "register",
|
||||
cat: { en: "Vehicles", sv: "Fordon" },
|
||||
price: 12200,
|
||||
artifact: "map",
|
||||
},
|
||||
{
|
||||
id: "financial-series",
|
||||
markets: "SE · NO · DK · FI",
|
||||
marketCodes: ["SE", "NO", "DK", "FI"],
|
||||
title: { en: "Financial series", sv: "Finansiella serier" },
|
||||
blurb: { en: "Revenue, result, KPIs.", sv: "Omsättning, resultat, nyckeltal." },
|
||||
count: { en: "12 years", sv: "12 år" },
|
||||
rows: 240000,
|
||||
freshness: { en: "annual", sv: "årlig" },
|
||||
level: 2,
|
||||
source: "register",
|
||||
cat: { en: "Financials", sv: "Finansiellt" },
|
||||
price: 14800,
|
||||
artifact: "chart",
|
||||
},
|
||||
{
|
||||
id: "buying-signals",
|
||||
markets: "SE · NO · DK · FI",
|
||||
marketCodes: ["SE", "NO", "DK", "FI"],
|
||||
title: { en: "Buying signals", sv: "Köpsignaler" },
|
||||
blurb: { en: "Ads, news, tech changes. Intent per company.", sv: "Annonser, nyheter, teknikbyten. Intent per bolag." },
|
||||
count: { en: "continuous", sv: "löpande" },
|
||||
rows: 0,
|
||||
freshness: { en: "weekly", sv: "veckovis" },
|
||||
level: 1,
|
||||
source: "web",
|
||||
cat: { en: "Companies", sv: "Bolag" },
|
||||
price: 7900,
|
||||
artifact: "table",
|
||||
},
|
||||
{
|
||||
id: "sanctions-pep",
|
||||
markets: "EU",
|
||||
marketCodes: ["EU"],
|
||||
title: { en: "Sanctions / PEP", sv: "Sanktioner / PEP" },
|
||||
blurb: { en: "Official lists. Automated screening.", sv: "Officiella listor. Automatisk screening." },
|
||||
count: { en: "global", sv: "global" },
|
||||
rows: 0,
|
||||
freshness: { en: "daily", sv: "daglig" },
|
||||
level: 3,
|
||||
source: "OpenSanctions",
|
||||
cat: { en: "Compliance", sv: "Efterlevnad" },
|
||||
price: 5900,
|
||||
artifact: "table",
|
||||
},
|
||||
];
|
||||
|
||||
export function findDataset(raw: string | undefined): Dataset | undefined {
|
||||
if (!raw) return undefined;
|
||||
const slug = decodeURIComponent(raw).toLowerCase();
|
||||
return CATALOG.find((d) => d.id === slug);
|
||||
}
|
||||
+4
-1
@@ -1,7 +1,10 @@
|
||||
import type { MetadataRoute } from "next";
|
||||
|
||||
const BASE = "https://0pt.app";
|
||||
const ROUTES = ["", "/tjanster", "/katalog", "/kallor", "/bestall", "/bestall/beskriv", "/bestall/forskott"];
|
||||
// /bestall, /bestall/beskriv and /bestall/forskott are deliberately noindex
|
||||
// (app/bestall/layout.tsx) — the order flow is transactional, not a landing
|
||||
// page. Keep the sitemap in sync with that indexation policy.
|
||||
const ROUTES = ["", "/tjanster", "/katalog", "/kallor"];
|
||||
|
||||
export default function sitemap(): MetadataRoute.Sitemap {
|
||||
return ROUTES.map((r) => ({
|
||||
|
||||
Reference in New Issue
Block a user