From 3083be0c9dc9ec0ded58eda937b83fbdf511f386 Mon Sep 17 00:00:00 2001 From: Mohamed Bassem Date: Sun, 9 Nov 2025 11:50:58 +0000 Subject: feat: Add page titles (#2109) * feat: add Next.js metadata titles to dynamic and settings pages Add page titles using Next.js metadata API for better SEO and user experience: - List pages: Show list name in format " | Karakeep" - Tag pages: Show tag name in format " | Karakeep" - Admin pages: Add titles for overview, users, and background jobs pages - Settings pages: Add titles for all settings pages (API keys, AI, feeds, import, info, webhooks, subscription, rules, stats, assets, broken links) For client components (rules, stats, assets, broken-links), created layout.tsx files to export metadata since metadata can only be exported from server components. * feat: add Next.js metadata titles to dashboard pages Add page titles using Next.js metadata API to archive, favourites, highlights, and all tags pages: - Archive page: Show "Archive | Karakeep" - Favourites page: Show "Favourites | Karakeep" - Highlights page: Show "Highlights | Karakeep" - All Tags page: Show "All Tags | Karakeep" Improves SEO and user experience across all dashboard browsing pages. * refactor: use i18n translations for dashboard page titles Convert hardcoded page titles to use translations via generateMetadata: - Archive page: Uses common.archive translation - Favourites page: Uses lists.favourites translation - Highlights page: Uses common.highlights translation - All Tags page: Uses tags.all_tags translation Improves localization support across dashboard pages. * feat: add i18n translations to admin and settings page titles Convert hardcoded page titles to use translations via generateMetadata: - Admin Overview: Uses admin.admin_settings translation - AI Settings: Uses settings.ai.ai_settings translation - API Keys: Uses settings.api_keys.api_keys translation - Feed Settings: Uses settings.feeds.rss_subscriptions translation - Import/Export: Uses settings.import.import_export translation - Account Info: Uses settings.info.user_info translation - Subscription: Uses settings.subscription.subscription translation - Webhooks: Uses settings.webhooks.webhooks translation Improves localization support across admin and settings pages. * revert accidental commit * more translations * more fixes --------- Co-authored-by: Claude --- apps/web/app/dashboard/lists/[listId]/page.tsx | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) (limited to 'apps/web/app/dashboard/lists') diff --git a/apps/web/app/dashboard/lists/[listId]/page.tsx b/apps/web/app/dashboard/lists/[listId]/page.tsx index 4714a71c..3f9c3416 100644 --- a/apps/web/app/dashboard/lists/[listId]/page.tsx +++ b/apps/web/app/dashboard/lists/[listId]/page.tsx @@ -1,3 +1,4 @@ +import type { Metadata } from "next"; import { notFound } from "next/navigation"; import Bookmarks from "@/components/dashboard/bookmarks/Bookmarks"; import ListHeader from "@/components/dashboard/lists/ListHeader"; @@ -6,6 +7,23 @@ import { TRPCError } from "@trpc/server"; import { BookmarkListContextProvider } from "@karakeep/shared-react/hooks/bookmark-list-context"; +export async function generateMetadata(props: { + params: Promise<{ listId: string }>; +}): Promise { + const params = await props.params; + try { + const list = await api.lists.get({ listId: params.listId }); + return { + title: `${list.name} | Karakeep`, + }; + } catch (e) { + if (e instanceof TRPCError && e.code === "NOT_FOUND") { + notFound(); + } + throw e; + } +} + export default async function ListPage(props: { params: Promise<{ listId: string }>; searchParams?: Promise<{ -- cgit v1.2.3-70-g09d2