diff options
| author | Mohamed Bassem <me@mbassem.com> | 2025-06-07 16:46:36 +0000 |
|---|---|---|
| committer | Mohamed Bassem <me@mbassem.com> | 2025-06-07 16:46:36 +0000 |
| commit | bc65a73872cf0707d2433c289d1f04423325ed95 (patch) | |
| tree | 95de3c17907e0ea79fbca1d058263b87b3bb4c6f /apps/web/app/public | |
| parent | a98f02369c5b2aea8831cbbff840fbd2ae395a7d (diff) | |
| download | karakeep-bc65a73872cf0707d2433c289d1f04423325ed95.tar.zst | |
fix: Use a new public list metadata endpoint for metadata generation
Diffstat (limited to 'apps/web/app/public')
| -rw-r--r-- | apps/web/app/public/lists/[listId]/page.tsx | 16 |
1 files changed, 13 insertions, 3 deletions
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<Metadata> { - // 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} |
