From bc65a73872cf0707d2433c289d1f04423325ed95 Mon Sep 17 00:00:00 2001 From: Mohamed Bassem Date: Sat, 7 Jun 2025 16:46:36 +0000 Subject: fix: Use a new public list metadata endpoint for metadata generation --- apps/web/app/public/lists/[listId]/page.tsx | 16 +++++++++++++--- apps/web/components/public/lists/PublicBookmarkGrid.tsx | 1 + 2 files changed, 14 insertions(+), 3 deletions(-) (limited to 'apps') diff --git a/apps/web/app/public/lists/[listId]/page.tsx b/apps/web/app/public/lists/[listId]/page.tsx index c0495b9f..cdfc46d0 100644 --- a/apps/web/app/public/lists/[listId]/page.tsx +++ b/apps/web/app/public/lists/[listId]/page.tsx @@ -12,13 +12,22 @@ export async function generateMetadata({ }: { params: { listId: string }; }): Promise { - // TODO: Don't load the entire list, just create an endpoint to get the list name try { - const resp = await api.publicBookmarks.getPublicBookmarksInList({ + const resp = await api.publicBookmarks.getPublicListMetadata({ listId: params.listId, }); return { - title: `${resp.list.name} - Karakeep`, + title: `${resp.name} by ${resp.ownerName} - Karakeep`, + description: + resp.description && resp.description.length > 0 + ? `${resp.description} by ${resp.ownerName} on Karakeep` + : undefined, + applicationName: "Karakeep", + authors: [ + { + name: resp.ownerName, + }, + ], }; } catch (e) { if (e instanceof TRPCError && e.code === "NOT_FOUND") { @@ -67,6 +76,7 @@ export default async function PublicListPage({ description: list.description, icon: list.icon, numItems: list.numItems, + ownerName: list.ownerName, }} bookmarks={bookmarks} nextCursor={nextCursor} diff --git a/apps/web/components/public/lists/PublicBookmarkGrid.tsx b/apps/web/components/public/lists/PublicBookmarkGrid.tsx index 038ac3ae..0aa16eae 100644 --- a/apps/web/components/public/lists/PublicBookmarkGrid.tsx +++ b/apps/web/components/public/lists/PublicBookmarkGrid.tsx @@ -192,6 +192,7 @@ export default function PublicBookmarkGrid({ description: string | null | undefined; icon: string; numItems: number; + ownerName: string; }; bookmarks: ZPublicBookmark[]; nextCursor: ZCursor | null; -- cgit v1.2.3-70-g09d2