From 0cea2e9b70d9c4a73da086f35352e35c8795e933 Mon Sep 17 00:00:00 2001 From: bryantgillespie Date: Tue, 7 Jan 2025 11:55:47 -0500 Subject: [PATCH 1/2] add a lineclamp in case of description --- components/OgImage/Default.vue | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/components/OgImage/Default.vue b/components/OgImage/Default.vue index 8391d94..d705cdd 100644 --- a/components/OgImage/Default.vue +++ b/components/OgImage/Default.vue @@ -89,7 +89,7 @@ defineProps();
-
+
{{ publishedAt }}
From 594024bd10b2fa37d39bbd2ed846f821bb4b942a Mon Sep 17 00:00:00 2001 From: bryantgillespie Date: Tue, 7 Jan 2025 11:55:55 -0500 Subject: [PATCH 2/2] add templates page case --- utils/og.ts | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/utils/og.ts b/utils/og.ts index 60770ed..245f821 100644 --- a/utils/og.ts +++ b/utils/og.ts @@ -55,6 +55,18 @@ export function getOgProps(baseUrl: string, collection: string, item = {} as any }; } + case 'templates': { + return { + ...props, + title: item.name ?? 'Directus Template', + imageUrl: `${baseUrl}/${item.image?.id}?format=jpeg&width=800`, + badgeLabel: 'Directus Template', + publishedAt: item.description, + authorName: userName(item.creator), + authorImage: `${baseUrl}/${item.creator?.avatar}?format=jpeg&width=800`, + }; + } + default: return props; }