From 38c5fb4aceaee23f9ab3d77573e6ebe530bd7c5f Mon Sep 17 00:00:00 2001 From: shadcn Date: Sat, 15 Feb 2025 14:06:30 +0400 Subject: [PATCH] feat(www): update og (#6658) * feat(www): update og * fix: remove export --- apps/www/app/(app)/blocks/layout.tsx | 35 ++++-- apps/www/app/(app)/charts/layout.tsx | 34 +++-- apps/www/app/(app)/colors/layout.tsx | 32 ++++- apps/www/app/(app)/docs/[[...slug]]/page.tsx | 16 ++- apps/www/app/(app)/examples/layout.tsx | 30 ++++- apps/www/app/(app)/og/geist-regular-otf.json | 1 + apps/www/app/(app)/og/geist-semibold-otf.json | 1 + .../app/(app)/og/geistmono-regular-otf.json | 1 + apps/www/app/(app)/og/route.tsx | 117 ++++++++++++++++++ apps/www/app/(app)/page.tsx | 36 +++++- apps/www/app/(app)/themes/layout.tsx | 38 ++++-- 11 files changed, 294 insertions(+), 47 deletions(-) create mode 100644 apps/www/app/(app)/og/geist-regular-otf.json create mode 100644 apps/www/app/(app)/og/geist-semibold-otf.json create mode 100644 apps/www/app/(app)/og/geistmono-regular-otf.json create mode 100644 apps/www/app/(app)/og/route.tsx diff --git a/apps/www/app/(app)/blocks/layout.tsx b/apps/www/app/(app)/blocks/layout.tsx index 1819a60e6a..2b52e49052 100644 --- a/apps/www/app/(app)/blocks/layout.tsx +++ b/apps/www/app/(app)/blocks/layout.tsx @@ -13,10 +13,32 @@ import { Button } from "@/registry/new-york/ui/button" import "@/styles/mdx.css" import Link from "next/link" +const title = "Building Blocks for the Web" +const description = + "Clean, modern building blocks. Copy and paste into your apps. Works with all React frameworks. Open Source. Free forever." + export const metadata: Metadata = { - title: "Building Blocks.", - description: - "Beautifully designed. Copy and paste into your apps. Open Source.", + title, + description, + openGraph: { + images: [ + { + url: `/og?title=${encodeURIComponent( + title + )}&description=${encodeURIComponent(description)}`, + }, + ], + }, + twitter: { + card: "summary_large_image", + images: [ + { + url: `/og?title=${encodeURIComponent( + title + )}&description=${encodeURIComponent(description)}`, + }, + ], + }, } export default function BlocksLayout({ @@ -28,11 +50,8 @@ export default function BlocksLayout({ <> - Building Blocks for the Web - - Clean, modern building blocks. Copy and paste into your apps. Works - with all React frameworks. Open Source. Free forever. - + {title} + {description}