import type { RenderFunctionInput } from "#src/types.js"; const { twj } = await import("tw-to-css"); // This preset demonstrates how to extract arbitrary content from an HTML file // and render it in an Open Graph image. export function customProperty({ title, document, }: RenderFunctionInput): React.ReactNode { // extract the body const body = document.querySelector("body")?.textContent ?? ""; // truncate the body to 50 characters, add ellipsis if truncated const bodyTruncated = body.slice(0, 50) + (body.length > 50 ? "..." : ""); return (

{title}

{bodyTruncated}
); }