feat(frontend): rich OG metadata + dynamic page titles across all routes
Some checks failed
lint / lint (push) Has been cancelled
test / unit (push) Has been cancelled
test / integration (push) Has been cancelled
lint / lint (pull_request) Has been cancelled
test / unit (pull_request) Has been cancelled
test / integration (pull_request) Has been cancelled

This commit is contained in:
2026-05-15 01:38:59 +02:00
parent 71a0f55c93
commit a123c0b8cc
11 changed files with 206 additions and 2 deletions

View File

@@ -1,3 +1,4 @@
import type { Metadata } from "next";
import {
getFollowersList,
getFollowingList,
@@ -7,6 +8,40 @@ import {
getUserThoughts,
Me,
} from "@/lib/api";
interface ProfilePageProps {
params: Promise<{ username: string }>;
}
export async function generateMetadata({
params,
}: ProfilePageProps): Promise<Metadata> {
const { username } = await params;
const user = await getUserProfile(username, null).catch(() => null);
if (!user) return { title: username };
const name = user.displayName || user.username;
const description =
user.bio ||
`Follow ${name} on Thoughts and across the Fediverse.`;
return {
title: `${name} (@${user.username})`,
description,
openGraph: {
type: "profile",
title: `${name} (@${user.username})`,
description,
images: user.avatarUrl ? [{ url: user.avatarUrl }] : [],
},
twitter: {
card: "summary",
title: `${name} (@${user.username})`,
description,
images: user.avatarUrl ? [user.avatarUrl] : [],
},
};
}
import { UserAvatar } from "@/components/user-avatar";
import { Calendar, Settings } from "lucide-react";
import { Card } from "@/components/ui/card";