Skip to content

The Open Standard for Generative UI

docs: branded share image for the homepage and blog index (#1428)

devin-ai-integration[bot]7ff25472ef91
diff --git a/docs/lib/og/entries.ts b/docs/lib/og/entries.ts
index 3ceb11391..5d8f12ccc 100644
--- a/docs/lib/og/entries.ts
+++ b/docs/lib/og/entries.ts
@@ -1,6 +1,6 @@
import { getIntegrationPageMetadata, integrations } from "@/app/(home)/integrations/data";
import { ogPages } from "@/generated/og-pages";
-import { pageOgImage } from "../page-metadata";
+import { pageOgImage, SITE_OG_IMAGE } from "../page-metadata";
import { blog, source } from "../source";
import { blogOgImage, docsOgImage } from "./content";
import type { OgImage } from "./images";
@@ -11,7 +11,7 @@ let images: Map<string, OgImage> | undefined;
export function getOgImages(): Map<string, OgImage> {
if (images) return images;
- const all: OgImage[] = [];
+ const all: OgImage[] = [SITE_OG_IMAGE];
for (const [path, page] of Object.entries(ogPages)) {
if (page.pathname !== path) {
throw new Error(`metadata.ts for ${path} declares pathname ${page.pathname}`);
diff --git a/docs/lib/og/images.ts b/docs/lib/og/images.ts
index 06ab66e09..d9b6ce62e 100644
--- a/docs/lib/og/images.ts
+++ b/docs/lib/og/images.ts
@@ -17,6 +17,7 @@ export function publicFileExists(path: string) {
function cardAssets(card: OgCardData) {
const assets = ["/shiro-logo.svg"];
if (card.template === "cover") assets.push(card.cover);
+ else if (card.template === "home") assets.push(card.art);
else if (card.partnerLogo) assets.push(card.partnerLogo);
return assets;
}
diff --git a/docs/lib/og/render.tsx b/docs/lib/og/render.tsx
index 579bb8a3d..9c7caf943 100644
--- a/docs/lib/og/render.tsx
+++ b/docs/lib/og/render.tsx
@@ -2,7 +2,7 @@ import { ImageResponse } from "@takumi-rs/image-response";
import { readFile } from "node:fs/promises";
import { extname, join } from "node:path";
import { ogImageFormat } from "./images";
-import { OG_SIZE, OgCard, type OgCardData, OgCover } from "./templates";
+import { OG_SIZE, OgCard, type OgCardData, OgCover, OgHome } from "./templates";
let fonts: Promise<{ name: string; weight: number; data: Buffer }[]> | undefined;
@@ -40,7 +40,14 @@ async function publicImage(path: string): Promise<string> {
export async function renderOgCard(card: OgCardData) {
const logo = await publicImage("/shiro-logo.svg");
const node =
- card.template === "cover" ? (
+ card.template === "home" ? (
+ <OgHome
+ logo={logo}
+ art={await publicImage(card.art)}
+ title={card.title}
+ tagline={card.tagline}
+ />
+ ) : card.template === "cover" ? (
<OgCover
src={await publicImage(card.cover)}
logo={logo}
diff --git a/docs/lib/og/templates.tsx b/docs/lib/og/templates.tsx
index 04f2e87ec..34cc87b9c 100644
--- a/docs/lib/og/templates.tsx
+++ b/docs/lib/og/templates.tsx
@@ -25,6 +25,13 @@ export type OgCardData =
/** Shown as `partnerLogo × OpenUI` above the title. */
partnerLogo?: string;
}
+ | {
+ /** Site-wide card for the homepage and blog index: tagline over product artwork. */
+ template: "home";
+ title: string;
+ tagline: string;
+ art: string;
+ }
| {
template: "cover";
/** Blog cover art, cropped to fill the top of the image. */
@@ -117,6 +124,52 @@ export function OgCard({ logo, eyebrow, title, description, partnerLogo }: OgCar
);
}
+type OgHomeProps = { logo: string; art: string; title: string; tagline: string };
+
+/** Homepage card: the hero's two-tone headline above the product artwork, which bleeds off the bottom. */
+export function OgHome({ logo, art, title, tagline }: OgHomeProps) {
+ return (
+ <div
+ style={{
+ display: "flex",
+ position: "relative",
+ ...OG_SIZE,
+ backgroundColor: COLORS.background,
+ fontFamily: "Inter",
+ }}
+ >
+ <img
+ alt=""
+ src={art}
+ style={{ position: "absolute", top: HOME_ART_TOP, left: -40, width: 1280, height: 503 }}
+ />
+ <div
+ style={{
+ display: "flex",
+ flexDirection: "column",
+ position: "absolute",
+ top: 56,
+ left: 72,
+ gap: 4,
+ fontSize: 60,
+ fontWeight: 600,
+ lineHeight: 1.1,
+ letterSpacing: "-0.03em",
+ }}
+ >
+ <div style={{ display: "flex", alignItems: "center", gap: 18, color: COLORS.primary }}>
+ <img alt="" src={logo} width={67} height={64} />
+ <span>{title}</span>
+ </div>
+ <span style={{ color: COLORS.secondary }}>{tagline}</span>
+ </div>
+ </div>
+ );
+}
+
+/** Where the homepage artwork starts; its own top margin leaves room for the headline. */
+const HOME_ART_TOP = 170;
+
/**
* Height of the cover art. The art fills the top of the image, and the title sits on the dark
* band below it, so text never overlaps the centered artwork most covers have.
diff --git a/docs/lib/page-metadata.ts b/docs/lib/page-metadata.ts
index e807163d6..877940cb7 100644
--- a/docs/lib/page-metadata.ts
+++ b/docs/lib/page-metadata.ts
@@ -4,18 +4,20 @@ import { type OgImage, ogImageMetadata } from "./og/images";
export const SITE_NAME = "OpenUI - The Open Standard for Generative UI";
/** Site-wide card, used by the homepage and the blog index. */
+export const SITE_OG_IMAGE: OgImage = {
+ path: "/home",
+ card: {
+ template: "home",
+ title: "OpenUI",
+ tagline: "Open Standard for Generative UI",
+ art: "/homepage/openui-lang-light.webp",
+ },
+};
+
export const SITE_OPEN_GRAPH = {
type: "website",
siteName: SITE_NAME,
- images: [
- {
- url: "/meta-image.png?v=20260725-1708",
- type: "image/png",
- width: 1800,
- height: 942,
- alt: "OpenUI preview",
- },
- ],
+ images: [ogImageMetadata(SITE_OG_IMAGE)],
} satisfies Metadata["openGraph"];
/**