diff --git a/website/.gitignore b/website/.gitignore index 5ef6a520..de08fad0 100644 --- a/website/.gitignore +++ b/website/.gitignore @@ -39,3 +39,8 @@ yarn-error.log* # typescript *.tsbuildinfo next-env.d.ts + +# package managers — use bun only +package-lock.json +yarn.lock +pnpm-lock.yaml diff --git a/website/app/api/og/route.tsx b/website/app/api/og/route.tsx new file mode 100644 index 00000000..a99ea08f --- /dev/null +++ b/website/app/api/og/route.tsx @@ -0,0 +1,13 @@ +import { NextRequest } from "next/server"; +import { renderOgImage } from "../../lib/og-image"; + +export const runtime = "edge"; + +export async function GET(request: NextRequest) { + const { searchParams } = new URL(request.url); + + const title = searchParams.get("title") ?? undefined; + const description = searchParams.get("description") ?? undefined; + + return renderOgImage(title, description); +} diff --git a/website/app/layout.tsx b/website/app/layout.tsx index 8caf5d1f..d774c56b 100644 --- a/website/app/layout.tsx +++ b/website/app/layout.tsx @@ -35,12 +35,21 @@ export const metadata: Metadata = { url: "/", siteName: "RxCode", locale: "en_US", + images: [ + { + url: "/api/og", + width: 1200, + height: 630, + alt: "RxCode — The Visual Command Center for AI Coding Agents", + }, + ], }, twitter: { card: "summary_large_image", title: "RxCode — The Visual Command Center for AI Coding Agents", description: "A native macOS desktop client for AI coding agents. Visual sessions, project tree, and code review in one place.", + images: ["/api/og"], }, }; diff --git a/website/app/lib/og-image.tsx b/website/app/lib/og-image.tsx new file mode 100644 index 00000000..27135a5e --- /dev/null +++ b/website/app/lib/og-image.tsx @@ -0,0 +1,128 @@ +import { ImageResponse } from "next/og"; + +export const OG_SIZE = { width: 1200, height: 630 }; + +export function renderOgImage( + title = "The Visual Command Center for AI Coding Agents", + description = "Native macOS · Claude Code & Codex · Free & Open Source" +): ImageResponse { + return new ImageResponse( + ( +