e7738de6d2
CI / Deep Native Runtime Cases (1/6) (push) Has been skipped
CI / Native Preflight (push) Failing after 1s
CI / Native Runtime Cases (1/2) (push) Failing after 0s
CI / Native Runtime Cases (2/2) (push) Failing after 1s
CI / Native Metadata Reports (push) Failing after 0s
CI / Native Direct Backend Artifacts (push) Failing after 0s
CI / Native Sanitizer Smoke (push) Failing after 1s
CI / Command Contract Snapshots (push) Failing after 1s
CI / Deep Conformance Suite (push) Has been skipped
CI / Graph Build Perf (push) Failing after 1s
CI / Deep Native Preflight (push) Has been skipped
CI / Deep Native Runtime Cases (2/6) (push) Has been skipped
CI / Deep Native Runtime Cases (3/6) (push) Has been skipped
CI / Conformance Suite (push) Failing after 1s
CI / Workspace Checks (push) Failing after 0s
CI / Deep Native Runtime Cases (5/6) (push) Has been skipped
CI / Deep Native Runtime Cases (6/6) (push) Has been skipped
CI / Deep Native Runtime Cases (4/6) (push) Has been skipped
CI / Deep Graph Build Perf (push) Has been skipped
46 lines
1.3 KiB
TypeScript
46 lines
1.3 KiB
TypeScript
import type { Metadata } from "next";
|
|
import { PAGE_TITLES } from "./page-titles";
|
|
import { findDocByPath } from "./docs";
|
|
|
|
const SITE_NAME = "Zero";
|
|
const DESCRIPTION =
|
|
"zerolang is an experimental graph-first programming language where agents work with semantic program structure instead of raw source text.";
|
|
|
|
export function pageMetadata(slug: string): Metadata {
|
|
const title = PAGE_TITLES[slug];
|
|
if (title === undefined) return {};
|
|
|
|
const displayTitle = title.replace(/\n/g, " ");
|
|
const fullTitle = slug === "" ? `${SITE_NAME} | ${displayTitle}` : `${displayTitle} | ${SITE_NAME}`;
|
|
const ogImageUrl = slug ? `/og/${slug}` : "/og";
|
|
|
|
const doc = slug ? findDocByPath(`/${slug}`) : null;
|
|
const description = doc?.description ?? DESCRIPTION;
|
|
|
|
return {
|
|
title: slug === "" ? fullTitle : displayTitle,
|
|
description,
|
|
openGraph: {
|
|
type: "website",
|
|
locale: "en_US",
|
|
siteName: SITE_NAME,
|
|
title: fullTitle,
|
|
description,
|
|
images: [
|
|
{
|
|
url: ogImageUrl,
|
|
width: 1200,
|
|
height: 630,
|
|
alt: `${displayTitle} — ${SITE_NAME}`,
|
|
},
|
|
],
|
|
},
|
|
twitter: {
|
|
card: "summary_large_image",
|
|
title: fullTitle,
|
|
description,
|
|
images: [ogImageUrl],
|
|
},
|
|
};
|
|
}
|