Skip to content

Commit 594024b

Browse files
add templates page case
1 parent 0cea2e9 commit 594024b

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

utils/og.ts

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,18 @@ export function getOgProps(baseUrl: string, collection: string, item = {} as any
5555
};
5656
}
5757

58+
case 'templates': {
59+
return {
60+
...props,
61+
title: item.name ?? 'Directus Template',
62+
imageUrl: `${baseUrl}/${item.image?.id}?format=jpeg&width=800`,
63+
badgeLabel: 'Directus Template',
64+
publishedAt: item.description,
65+
authorName: userName(item.creator),
66+
authorImage: `${baseUrl}/${item.creator?.avatar}?format=jpeg&width=800`,
67+
};
68+
}
69+
5870
default:
5971
return props;
6072
}

0 commit comments

Comments
 (0)