Aymeric Rabot 9a0f83a1ec
feat: SEO improvements, OG image endpoint, favicon, and metadata (#104)
- Add dynamic OG image generation endpoint (/og) adapted from monorepo
- Replace favicon with monorepo version, remove unused icon.svg
- Add seo.ts config, robots.ts, sitemap.ts for better search indexing
- Add per-page metadata (editor, viewer, settings, profile, community)
- Remove stale package-lock.json that caused ENOWORKSPACES errors with Next.js
- Add OG fonts (Geist Regular, Plus Jakarta Sans SemiBold)

Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-02-19 13:38:34 -05:00

46 lines
1.2 KiB
TypeScript

export const dynamic = 'force-dynamic'
import type { Metadata } from 'next'
import { notFound } from 'next/navigation'
import { getPublicProfile } from '@/features/community/lib/auth/actions'
import { getPublicProjectsByUserId } from '@/features/community/lib/projects/actions'
import { PublicProfilePage } from '@/features/community/components/public-profile-page'
export async function generateMetadata({
params,
}: {
params: Promise<{ username: string }>
}): Promise<Metadata> {
const { username } = await params
return {
title: `${username}'s Projects`,
description: `Public projects shared by @${username} on Pascal Editor.`,
alternates: {
canonical: `/u/${encodeURIComponent(username)}`,
},
}
}
export default async function ProfilePage({
params,
}: {
params: Promise<{ username: string }>
}) {
const { username } = await params
const profileResult = await getPublicProfile(username)
if (!profileResult.success || !profileResult.data) {
notFound()
}
const projectsResult = await getPublicProjectsByUserId(profileResult.data.id)
return (
<PublicProfilePage
profile={profileResult.data}
projects={projectsResult.data ?? []}
/>
)
}