This commit is contained in:
Chris Tate
2026-02-20 08:49:53 -06:00
committed by GitHub
parent 2b8a51b9a6
commit fca9d7ab5d
21 changed files with 247 additions and 15 deletions
+39
View File
@@ -0,0 +1,39 @@
import type { Metadata } from "next";
import { PAGE_TITLES } from "./page-titles";
const DESCRIPTION =
"Headless browser automation CLI for AI agents";
export function pageMetadata(slug: string): Metadata {
const title = PAGE_TITLES[slug];
if (!title) return {};
const displayTitle = title.replace(/\n/g, " ");
const fullTitle = `${displayTitle} | agent-browser`;
const ogImageUrl = slug ? `/og/${slug}` : "/og";
return {
title: displayTitle,
openGraph: {
type: "website",
locale: "en_US",
siteName: "agent-browser",
title: fullTitle,
description: DESCRIPTION,
images: [
{
url: ogImageUrl,
width: 1200,
height: 630,
alt: `${displayTitle} - agent-browser`,
},
],
},
twitter: {
card: "summary_large_image",
title: fullTitle,
description: DESCRIPTION,
images: [ogImageUrl],
},
};
}
+20
View File
@@ -0,0 +1,20 @@
export const PAGE_TITLES: Record<string, string> = {
"": "Headless Browser\nAutomation for AI",
installation: "Installation",
"quick-start": "Quick Start",
commands: "Commands",
configuration: "Configuration",
selectors: "Selectors",
snapshots: "Snapshots",
sessions: "Sessions",
diffing: "Diffing",
"cdp-mode": "CDP Mode",
streaming: "Streaming",
profiler: "Profiler",
ios: "iOS Simulator",
changelog: "Changelog",
};
export function getPageTitle(slug: string): string | null {
return slug in PAGE_TITLES ? PAGE_TITLES[slug]! : null;
}