| 1 | import { ImageResponse } from "next/og"; |
| 2 | import { |
| 3 | allEnglishWritings, |
| 4 | allGermanWritings, |
| 5 | } from "@/.content-collections/generated"; |
| 6 | import { |
| 7 | formatDate, |
| 8 | loadOgAssets, |
| 9 | OgFrame, |
| 10 | OG_HANDLE, |
| 11 | OG_NAME, |
| 12 | OG_SIZE, |
| 13 | truncate, |
| 14 | } from "@/lib/og"; |
| 15 | |
| 16 | export const runtime = |
| 17 | export const contentType = |
| 18 | export const size = |
| 19 | |
| 20 | export default async function |
| 21 | params: Promise |
| 22 | }) { |
| 23 | const params = |
| 24 | const post = |
| 25 | (p) => |
| 26 | ); |
| 27 | |
| 28 | const title = |
| 29 | const summary = |
| 30 | const date = |
| 31 | |
| 32 | const boldText = |
| 33 | const regularText = |
| 34 | |
| 35 | const [fonts, |
| 36 | |
| 37 | return new ImageResponse |
| 38 | ( |
| 39 | <OgFrame avatar={ |
| 40 | <div |
| 41 | style={{ display: |
| 42 | > |
| 43 | <span |
| 44 | style={{ |
| 45 | fontSize: 64, |
| 46 | fontWeight: 700, |
| 47 | color: "#ffffff", |
| 48 | lineHeight: 1.15, |
| 49 | }} |
| 50 | > |
| 51 | {title} |
| 52 | </span> |
| 53 | <span style={{ |
| 54 | {date} |
| 55 | </span> |
| 56 | {summary ? ( |
| 57 | <span |
| 58 | style={{ |
| 59 | fontSize: 32, |
| 60 | color: "#9ca3af", |
| 61 | lineHeight: 1.4, |
| 62 | marginTop: 40, |
| 63 | }} |
| 64 | > |
| 65 | {summary} |
| 66 | </span> |
| 67 | ) : null} |
| 68 | </div> |
| 69 | </OgFrame> |
| 70 | ), |
| 71 | { |
| 72 | ...size, |
| 73 | ...(fonts ? |
| 74 | }, |
| 75 | ); |
| 76 | } |