From d273a67a09b2ddd559501061df04a25c2f18805a Mon Sep 17 00:00:00 2001 From: briant Date: Fri, 18 Sep 2026 16:24:06 -0600 Subject: [PATCH] fix meta description on user profile page --- src/components/Profile/ProfileLayout2.tsx | 33 +++++++++++++++++++---- 1 file changed, 28 insertions(+), 5 deletions(-) diff --git a/src/components/Profile/ProfileLayout2.tsx b/src/components/Profile/ProfileLayout2.tsx index 490b7a7806..ea37ffb637 100644 --- a/src/components/Profile/ProfileLayout2.tsx +++ b/src/components/Profile/ProfileLayout2.tsx @@ -82,6 +82,33 @@ export function ProfileLayout2({ children }: { children: React.ReactNode }) { }, [user, overview, pathname]); // const { classes } = useStyles(); + // What this creator actually has, biggest two kinds first — a profile with only images should + // not advertise models. + const metaDescription = useMemo(() => { + if (!user?.username) return undefined; + const counts: [number, string][] = [ + [overview?.modelCount ?? 0, 'AI models'], + [overview?.imageCount ?? 0, 'images'], + [overview?.videoCount ?? 0, 'videos'], + [overview?.articleCount ?? 0, 'articles'], + [overview?.comicCount ?? 0, 'comics'], + ]; + const has = counts + .filter(([count]) => count > 0) + .sort((a, b) => b[0] - a[0]) + .slice(0, 2) + .map(([count, noun]) => `${abbreviateNumber(count)} ${noun}`); + + if (!has.length) + return `Browse ${user.username}'s AI models, images and articles on Civitai. Download or generate online.`; + + const followers = user.stats?.followerCountAllTime ?? 0; + const following = followers > 0 ? `, followed by ${abbreviateNumber(followers)} people` : ''; + return `${user.username} on Civitai: ${has.join( + ' and ' + )}${following}. Download or generate online.`; + }, [user?.username, user?.stats?.followerCountAllTime, overview]); + const userMetaImage = user?.profilePicture && !isBlobUrl(user.profilePicture.url) ? getEdgeUrl(user.profilePicture.url, { width: 1200 }) @@ -132,11 +159,7 @@ export function ProfileLayout2({ children }: { children: React.ReactNode }) { {user && user.username && stats && !blockedByThem ? (